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