This commit is contained in:
Jonas Maier 2025-12-03 23:48:31 +01:00
parent 429f9e1dc5
commit a0569441d3
Signed by: jonas
SSH Key Fingerprint: SHA256:yRTjlpb3jSdw2EnZLAWyB4AghBPI8tu42eFXiICyb1U

24
modules/services.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
name='Services'
recommend=0
if command -v systemctl >/dev/null 2>&1; then
available=1
else
available=0
fi
check() {
systemctl list-units --type=service --plain --no-legend --no-pager | while IFS= read -r line; do
service=$(printf '%s\n' "$line" | awk '{print $1}')
state=$(printf '%s\n' "$line" | awk '{print $4}')
[ -n "$service" ] || continue
if [ "$state" = "failed" ]; then
warn "$service" "" "Service $service failed"
else
ok "$service" "" "Service $service is $state"
fi
done
}