36 lines
587 B
Bash
Executable File
36 lines
587 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Run remote control server.
|
|
#
|
|
|
|
PIDFILE=/var/run/puzzlefw_remotectl.pid
|
|
|
|
start() {
|
|
echo "Starting PuzzleFW remote control server ..."
|
|
[ -f $PIDFILE ] && echo " ERROR: already running" && exit 1
|
|
start-stop-daemon -S -b -p $PIDFILE -a /opt/puzzlefw/lib/run-remotectl
|
|
}
|
|
|
|
stop() {
|
|
echo "Stopping PuzzleFW remote control server ..."
|
|
start-stop-daemon -K -s INT -p $PIDFILE
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
stop
|
|
sleep 1
|
|
start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|