New STATE number for service state
This commit is contained in:
parent
7fd8d18f63
commit
58001115ce
13
sats/sysd
13
sats/sysd
|
@ -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;
|
Loading…
Reference in New Issue