File: systemd-sysv

package info (click to toggle)
cruft-ng 0.9.77
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,836 kB
  • sloc: cpp: 1,748; sh: 816; python: 233; makefile: 97; ansic: 82; perl: 75
file content (49 lines) | stat: -rwxr-xr-x 1,218 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
set -e

test -z "$CRUFT_ROOT" || exit 0

test -d /var/lib/systemd/timers/ || exit 0

find /var/lib/systemd/timers/ -type f -printf "%f\n" | cut -d '-' -f 2-999 | cut -d '.' -f 1-2 | sort | while read -r unit
do
    stamp="/var/lib/systemd/timers/stamp-$unit"

    if test -e "/etc/systemd/system/$unit"
    then
        if grep -q "Persistent=true" "/etc/systemd/system/$unit"
        then
            echo "$stamp"
        fi
    elif test -e "/usr/lib/systemd/system/$unit"
    then
        if grep -q "Persistent=true" "/usr/lib/systemd/system/$unit"
        then
            echo "$stamp"
        fi
    # Buster is not UsrMerge'd
    elif test -e "/lib/systemd/system/$unit"
    then
        if grep -q "Persistent=true" "/lib/systemd/system/$unit"
        then
            echo "$stamp"
        fi
    elif test -e "/run/systemd/generator/$unit"
    then
        if grep -q "Persistent=true" "/run/systemd/generator/$unit"
        then
            echo "$stamp"
        fi
    fi
done

exit 0

#for f in $(cd /var/lib/systemd/timers/ ; echo *.timer)
#do
#  unit=${f#stamp-}
#  if [ "$(systemctl show $unit -p Persistent)" = "Persistent=yes" ]
#  then
#    echo "/var/lib/systemd/timers/$f"
#  fi
#done