add statusall
This commit is contained in:
parent
3546356b69
commit
6ead12c6f3
1 changed files with 19 additions and 2 deletions
21
servicectl
21
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
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue