Newer
Older

Alberto LIVIO BECCARIA
committed
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
################################################################################
# Check if all required systemd units are installed in the system
################################################################################
UNITS=(
abrtd.service
accounts-daemon.service
basic.target
display-manager.service
getty.target
graphical.target
kdm.service
multi-user.target
network-online.target
network.target
rescue.service
rescue.target
rtkit-daemon.service
sshd.service
switcheroo-control.service
systemd-update-utmp-runlevel.service
udisks2.service
usbguard.service
)
CHECK_DIRS=(
/etc/systemd
/usr/lib/systemd
)
UNITS_LEN=${#UNITS[@]}
# DON'T TOUCH UNDER THIS LINE! #################################################
echo
units_found=0
for f in "${UNITS[@]}"
do
found=0
for d in "${CHECK_DIRS[@]}"
do
if [[ $found == 0 ]];
then
cd $d
lines=$(find . -name $f | wc -l)
if [[ $lines != 0 ]]
then
found=1
units_found=$((units_found+1))
fi
fi
done
if [[ $found == 0 ]];
then
echo "Missing: $f"
fi
done
echo
echo "Summary:"
echo " - # units to check: $UNITS_LEN"
echo " - # units found: $units_found"