diff --git a/sats/sysd b/sats/sysd index be5a246..435db5d 100644 --- a/sats/sysd +++ b/sats/sysd @@ -19,6 +19,17 @@ source $ROOT/com/config_sats; SERV_LIST="ls /lib/systemd/system/sats-*"; 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; \ No newline at end of file