Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | ### BEGIN INIT INFO |
| 4 | # Provides: hiawatha httpd httpd-cgi |
| 5 | # Required-Start: $syslog $network $remote_fs |
| 6 | # Required-Stop: $syslog $network $remote_fs |
| 7 | # Default-Start: 2 3 4 5 |
| 8 | # Default-Stop: 0 1 6 |
| 9 | # Short-Description: Hiawatha webserver |
| 10 | # Description: Hiawatha, a secure and advanced webserver. |
| 11 | ### END INIT INFO |
| 12 | |
| 13 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 14 | DAEMON=sed_sbin_path/hiawatha |
| 15 | NAME=hiawatha |
| 16 | DESC="Hiawatha Web Server" |
| 17 | OPTS="" |
| 18 | |
| 19 | case "$1" in |
| 20 | start) |
| 21 | echo -n "Starting $DESC: " |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 22 | mkdir -p /var/log/hiawatha &> /dev/null |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 23 | start-stop-daemon --start -x "$DAEMON" -- $OPTS |
| 24 | echo "$NAME." |
| 25 | ;; |
| 26 | stop) |
| 27 | echo -n "Stopping $DESC: " |
| 28 | start-stop-daemon --stop -x "$DAEMON" |
| 29 | echo "$NAME." |
| 30 | ;; |
| 31 | restart|force-reload) |
| 32 | echo -n "Restarting $DESC: " |
| 33 | start-stop-daemon --stop -x "$DAEMON" |
| 34 | sleep 1 |
| 35 | start-stop-daemon --start -x "$DAEMON" -- $OPTS |
| 36 | echo "$NAME." |
| 37 | ;; |
| 38 | *) |
| 39 | N=/etc/init.d/$NAME |
| 40 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 |
| 41 | exit 1 |
| 42 | ;; |
| 43 | esac |
| 44 | |
| 45 | exit 0 |