From 6ead12c6f3b80e4fc0db61340749aeaf00aa4833 Mon Sep 17 00:00:00 2001 From: user333 Date: Mon, 8 Jun 2026 22:43:43 +0000 Subject: [PATCH] add statusall --- servicectl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/servicectl b/servicectl index 2d31fc8..873b1e7 100644 --- a/servicectl +++ b/servicectl @@ -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 \ No newline at end of file +esac