#!/bin/sh
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <service|ls> [<command>]"
echo "Commands: check, configtest, reload, restart, start, stop, disable, enable, order"
echo "List options: all, failed, off, on, rogue, started, stopped"
exit 1
fi
SERVICE="$1"
COMMAND="$2"
if [ "$SERVICE" = "ls" ]; then
case "$COMMAND" in
all|failed|off|on|rogue|started|stopped)
rcctl ls "$COMMAND"
;;
"")
rcctl ls
;;
*)
echo "Unbekannte List-Option: $COMMAND"
echo "Erlaubte Optionen: all, failed, off, on, rogue, started, stopped"
exit 1
;;
esac
else
case "$COMMAND" in
check|configtest|reload|restart|start|stop|disable|enable|order)
rcctl "$COMMAND" "$SERVICE"
;;
*)
echo "Unbekannter Befehl: $COMMAND"
echo "Erlaubte Befehle: check, configtest, reload, restart, start, stop, disable, enable, order"
exit 1
;;
esac
fi