add statusall
This commit is contained in:
parent
3546356b69
commit
6ead12c6f3
1 changed files with 19 additions and 2 deletions
19
servicectl
19
servicectl
|
|
@ -146,6 +146,19 @@ list_inactive_services ()
|
||||||
done
|
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
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
start_service "$2"
|
start_service "$2"
|
||||||
|
|
@ -194,7 +207,11 @@ case "$1" in
|
||||||
list_inactive_services
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue