From edd1e8700e6ad335b6521466a9984adc7308ef77 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 28 Jan 2018 19:08:11 +0100 Subject: [PATCH] fixed (tried to) sats.sysd --- sats/sysd | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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;