New STATE number for service state

This commit is contained in:
xdrm-brackets 2018-01-28 18:53:43 +01:00
parent 7fd8d18f63
commit 58001115ce
1 changed files with 12 additions and 1 deletions

View File

@ -19,6 +19,17 @@ source $ROOT/com/config_sats;
SERV_LIST="ls /lib/systemd/system/sats-*"; SERV_LIST="ls /lib/systemd/system/sats-*";
while sleep 1; do while sleep 1; do
for i in $SERV_LIST; do test "`systemctl is-active $(basename $i)`" = "active" && echo "SYSD1`basename $i`" >> $BUF_OUT || echo "SYSD0`basename $i`" >> $BUF_OUT; done; for i in $SERV_LIST; do
status="`systemctl is-active $(basename $i)`";
test "$status" = "failed" && echo -n "SYSD0" >> $BUF_OUT;
test "$status" = "inactive" && echo -n "SYSD1" >> $BUF_OUT;
test "$status" = "activating" && echo -n "SYSD2" >> $BUF_OUT;
test "$status" = "active" && echo -n "SYSD3" >> $BUF_OUT;
echo "`basename $i`" >> $BUF_OUT;
done;
done; done;