Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 4 | DAEMON=/usr/sbin/monkey |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 5 | NAME=monkey |
| 6 | DESC="Monkey HTTP Server" |
| 7 | OPTS="--daemon" |
| 8 | |
| 9 | case "$1" in |
| 10 | start) |
| 11 | echo -n "Starting $DESC: " |
| 12 | start-stop-daemon --start -x "$DAEMON" -- $OPTS |
| 13 | echo "$NAME." |
| 14 | ;; |
| 15 | stop) |
| 16 | echo -n "Stopping $DESC: " |
| 17 | start-stop-daemon --stop -x "$DAEMON" |
| 18 | echo "$NAME." |
| 19 | ;; |
| 20 | restart|force-reload) |
| 21 | echo -n "Restarting $DESC: " |
| 22 | start-stop-daemon --stop -x "$DAEMON" |
| 23 | sleep 1 |
| 24 | start-stop-daemon --start -x "$DAEMON" -- $OPTS |
| 25 | echo "$NAME." |
| 26 | ;; |
| 27 | *) |
| 28 | N=/etc/init.d/$NAME |
| 29 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 |
| 30 | exit 1 |
| 31 | ;; |
| 32 | esac |
| 33 | |
| 34 | exit 0 |