add statusall

This commit is contained in:
user333 2026-06-08 22:43:43 +00:00
commit 6ead12c6f3

View file

@ -146,6 +146,19 @@ list_inactive_services ()
done
}
service_status_all ()
{
SERVICES=($(list_services))
for SERV in "${SERVICES[@]}"; do
service_active "${SERV}"
if [[ "$?" == "0" ]]; then
echo "Service '${SERV}' is currently running"
else
echo "Service '${SERV}' is currently not running"
fi
done
}
case "$1" in
start)
start_service "$2"
@ -193,8 +206,12 @@ case "$1" in
listinactive)
list_inactive_services
;;
statusall)
service_status_all
;;
*)
exit_code "1" "" "Expected one of (start|stop|restart|status|startall|stopall|restartall|listall|listactive|listinactive)"
exit_code "1" "" "Expected one of (start|stop|restart|status|statusall|startall|stopall|restartall|listall|listactive|listinactive)"
;;
esac
esac