5 # Start or stop wifi-radar in daemon mode.
7 # Written by Ante Karamatic <ivoks@grad.hr>
9 # Modified by Brian Elliott Finley <brian@thefinleys.com>
12 PATH
=/bin
:/usr
/bin
:/sbin
:/usr
/sbin
13 WR_BIN
="/usr/sbin/wifi-radar"
14 ETH
=`grep interface /etc/wifi-radar/wifi-radar.conf 2>/dev/null | cut -d' ' -f3 2>/dev/null`
15 PIDFILE
="/var/run/wifi-radar-daemon.pid"
16 DHCP_PID
=`cat /var/run/dhcpcd-wifi.pid 2>/dev/null`
18 .
/lib
/lsb
/init-functions
22 vpnc-disconnect
>/dev
/null
2>&1
23 log_begin_msg
"Starting wifi-radar daemon..."
24 start-stop-daemon
--start --quiet --pidfile $PIDFILE --exec "${WR_BIN}" -- -d >/dev
/null
2>&1 &
28 log_begin_msg
"Stopping wifi-radar daemon..."
29 start-stop-daemon
--stop --retry=1 --pidfile $PIDFILE --quiet --exec "${WR_BIN}" >/dev
/null
2>&1
30 kill -9 $DHCP_PID >/dev
/null
2>&1
31 ifconfig
"${ETH}" down
>/dev
/null
2>&1
39 log_success_msg
"Usage: /etc/init.d/wifi-radar {start|stop|restart}" >&2