Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://unix.stackexchange.com/questions/396630/the-proper-way-to-test-if-a-service-is-running-in-a-script

systemctl show -p SubState --value hassio-supervisor
#!/bin/bash
x=$(systemctl is-active hassio-supervisor | grep -w failed)
echo "x=${x}"
while true ; do
  echo "In While Loop"
 if [ "${x}" = "failed" ] ; then
  echo "breaking"
  break
 fi
break
done
  • No labels