diff --git a/sats/sysd b/sats/sysd index 435db5d..0799845 100644 --- a/sats/sysd +++ b/sats/sysd @@ -22,13 +22,21 @@ while sleep 1; do for i in $SERV_LIST; do status="`systemctl is-active $(basename $i)`"; + serv="`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; + if [ "$status" = "failed" ]; then + echo -n "SYSD0$serv" >> $BUF_OUT; - echo "`basename $i`" >> $BUF_OUT; + elif [ "$status" = "inactive" ]; then + echo -n "SYSD1$serv" >> $BUF_OUT; + + elif [ "$status" = "activating" ]; then + echo -n "SYSD2$serv" >> $BUF_OUT; + + elif [ "$status" = "active" ]; then + echo -n "SYSD3$serv" >> $BUF_OUT; + + fi; done;