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