systemd check
This commit is contained in:
parent
704546b018
commit
3107d58370
1 changed files with 16 additions and 0 deletions
16
check_systemd.sh
Executable file
16
check_systemd.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
retcode=0
|
||||||
|
for i in "$@"; do
|
||||||
|
active=$(systemctl is-active "$i")
|
||||||
|
if [ "$?" -ne 0 ]; then
|
||||||
|
echo -n "$i is $active; "
|
||||||
|
retcode=2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$retcode" -eq 0 ]; then
|
||||||
|
echo -n "all services are active"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
exit
|
Loading…
Reference in a new issue