3 # Start or stop wifi-radar daemon.
5 # Written by Ante Karamatic <ivoks@grad.hr>
7 PATH
=/bin
:/usr
/bin
:/sbin
:/usr
/sbin
8 WR_BIN
="/usr/sbin/wifi-radar"
9 ETH
=`grep interface /etc/wifi-radar.conf 2>/dev/null | cut -d' ' -f3 2>/dev/null`
10 PIDFILE
="/var/run/wifi-radar-daemon.pid"
11 DHCP_PID
=`cat /var/run/dhcpcd-wifi.pid 2>/dev/null`
13 .
/lib
/lsb
/init-functions
17 log_begin_msg
"Starting wifi-radar daemon..."
18 start-stop-daemon
--start --quiet --pidfile $PIDFILE --exec "${WR_BIN}" -- -d >/dev
/null
2>&1 &
22 log_begin_msg
"Stopping wifi-radar daemon..."
23 start-stop-daemon
--stop --retry=1 --pidfile $PIDFILE --quiet --exec "${WR_BIN}" >/dev
/null
2>&1
24 kill -9 $DHCP_PID >/dev
/null
2>&1
25 ifconfig
"${ETH}" down
>/dev
/null
2>&1
33 log_success_msg
"Usage: /etc/init.d/wifi-radar {start|stop|restart}" >&2