8 WPA_SUPPLICANT
=/usr
/sbin
/wpa_supplicant
9 WPA_CLI
=/usr
/sbin
/wpa_cli
10 IFCONFIG
=/sbin
/ifconfig
13 ACTION_SCRIPT
=/usr
/bin
/wpa_auto_action
17 stat_busy
"Starting $DAEMON_NAME daemon"
18 if [[ ! -f /run
/daemons
/$DAEMON_NAME ]]; then
19 $IP link
set $INTERFACE up
&&\
20 $WPA_SUPPLICANT -D$WPA_DRIVER -i$INTERFACE -c$WPA_CONFIG $WPA_OPTIONS -B &&\
21 $WPA_CLI -i$INTERFACE -a$ACTION_SCRIPT $WPA_CLI_OPTIONS -B
22 if [[ $?
-gt 0 ]]; then
26 add_daemon
$DAEMON_NAME
35 stat_busy
"Stopping $DAEMON_NAME daemon"
36 if [[ -f /run
/daemons
/$DAEMON_NAME ]]; then
37 rm_daemon
$DAEMON_NAME
38 $DHCPCD -qx $INTERFACE &>/dev
/null
39 $WPA_CLI -i$INTERFACE terminate
&>/dev
/null
&&\
40 $IP link
set $INTERFACE down
41 if [[ $?
-gt 0 ]]; then
58 stat_busy
"Reseting $DAEMON_NAME daemon"
59 if [[ -f /run
/daemons
/$DAEMON_NAME ]]; then
60 $WPA_CLI -i$INTERFACE reassociate
&>/dev
/null
61 if [[ $?
-gt 0 ]]; then
73 echo "usage: $0 {start|stop|restart|reset}"