blob: ef4fb5aa8154dcfd8c5d358e0c91ed8ca62ae4b4 [file] [log] [blame]
#!/bin/sh
# Command Runner init script.
. /etc/utils.sh
APP="commandrunner"
BINARY="/app/spacecast/commandrunner"
FLAGS="-logtostderr"
running() {
[ -n "$(pgrep -f "$BINARY")" ]
}
case "$1" in
start)
if running; then
echo "Command Runner is already running!"
else
babysit_start 10 "$APP" "$BINARY" "$FLAGS"
fi
;;
stop)
pkill -f "$BINARY"
;;
restart|reload)
$0 stop;$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac