blob: 5d74d13d9df2ef050762c1e6e21723e583e6a04f [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001#!/bin/sh
2
3PATH=/sbin:/bin:/usr/bin
4
5DAEMON="owhttpd"
6
7test -f /usr/bin/${DAEMON} || exit 0
8
9if test -f /etc/default/${DAEMON} ; then
10. /etc/default/${DAEMON}
11else
12:
13fi
14
15if [ "$START_OWHTTPD" != "yes" ]
16then
17 exit 0
18fi
19
20
21startdaemon(){
22 echo -n "Starting ${DAEMON}: "
23 start-stop-daemon --start -x /usr/bin/${DAEMON} -- ${CMDLINE} --pid_file /var/run/${DAEMON}.pid
24 echo "done"
25}
26
27stopdaemon(){
28 echo -n "Stopping ${DAEMON}: "
29 start-stop-daemon --stop -p /var/run/${DAEMON}.pid
30 echo "done"
31}
32
33
34
35case "$1" in
36 start)
37 startdaemon
38 ;;
39 stop)
40 stopdaemon
41 ;;
42 force-reload)
43 stopdaemon
44 startdaemon
45 ;;
46 restart)
47 stopdaemon
48 startdaemon
49 ;;
50 reload)
51 stopdaemon
52 startdaemon
53 ;;
54 *)
55 echo "Usage: ${DAEMON} { start | stop | restart | reload }" >&2
56 exit 1
57 ;;
58esac
59
60exit 0