ec0175a343756638049846b92562e3cf1049c6ca
Benjamin Renard Release svn.r1461-2

Benjamin Renard authored 12 years ago

1) #!/bin/sh
2) ### BEGIN INIT INFO
3) # Provides:	    wifidog-gateway
4) # Required-Start:    $local_fs $remote_fs $network $syslog $named
5) # Required-Stop:     $local_fs $remote_fs $network $syslog $named
6) # Default-Start:     2 3 4 5
7) # Default-Stop:	0 1 6
8) # X-Interactive:     true
9) # Short-Description: Start/stop wifidog gateway daemon
10) ### END INIT INFO
11) 
12) DAEMON_BIN=/usr/bin/wifidog
13) WDCTL_BIN=/usr/bin/wdctl
14) DAEMON_DEFS=/etc/default/wifidog-gateway
15) DAEMON_CONF=/etc/wifidog.conf
Benjamin Renard Redirect all wifidog output...

Benjamin Renard authored 10 years ago

16) LOG_FILE=/var/log/wifidog
Benjamin Renard Release svn.r1461-2

Benjamin Renard authored 12 years ago

17) LOG_LEVEL=6
18) OPTIONS=""
19) NAME=wifidog-gateway
20) DESC="Wifidog Gateway"
21) 
22) [ -x "$DAEMON_BIN" ] || exit 0
23) [ -s "$DAEMON_DEFS" ] && . $DAEMON_DEFS
24) [ ! -r "$DAEMON_CONF" ] && echo "Configuration file $DAEMON_CONF not present or unreadable" && exit 0
25) [ "$WIFIDOG_ENABLED" != "yes" ] && echo "$NAME disabled. see /etc/default/wifidog-gateway." && exit 0
26) 
27) DAEMON_OPTS="-c $DAEMON_CONF -s -d $LOG_LEVEL"
28) 
29) . /lib/lsb/init-functions
30) 
31) case "$1" in
32) 	start)
33) 		log_daemon_msg "Starting $DESC" "$NAME"
Benjamin Renard Redirect all wifidog output...

Benjamin Renard authored 10 years ago

34) 		start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_BIN" -- $DAEMON_OPTS > $LOG_FILE 2>&1
Benjamin Renard Release svn.r1461-2

Benjamin Renard authored 12 years ago

35) 		log_end_msg "$?"
36) 		;;
37) 	stop)
38) 		log_daemon_msg "Stopping $DESC" "$NAME"
Benjamin Renard Redirect all wifidog output...

Benjamin Renard authored 10 years ago

39) 		start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_BIN" > $LOG_FILE 2>&1