4 WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
5 WPA_SUP_PNAME="wpa_supplicant"
6 WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
7 WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE"
12 if [ -s "$IF_WPA_CONF" ]; then
13 WPA_SUP_CONF="-c $IF_WPA_CONF"
18 if [ ! -x "$WPA_SUP_BIN" ]; then
20 if [ "$VERBOSITY" = "1" ]; then
21 echo "$WPA_SUP_PNAME: binaries not executable or missing from $WPA_SUP_BIN"
27 if [ "$MODE" = "start" ] ; then
28 # driver type of interface, defaults to wext when undefined
29 if [ -s "/etc/wpa_supplicant/driver.$IFACE" ]; then
30 IF_WPA_DRIVER=$(cat "/etc/wpa_supplicant/driver.$IFACE")
31 elif [ -z "$IF_WPA_DRIVER" ]; then
33 if [ "$VERBOSITY" = "1" ]; then
34 echo "$WPA_SUP_PNAME: wpa-driver not provided, using \"wext\""
40 # if we have passed the criteria, start wpa_supplicant
41 if [ -n "$WPA_SUP_CONF" ]; then
43 if [ "$VERBOSITY" = "1" ]; then
44 echo "$WPA_SUP_PNAME: $WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER"
47 start-stop-daemon --start --quiet \
48 --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \
49 -- $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER
52 # if the interface socket exists, then wpa_supplicant was invoked successfully
53 if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
55 if [ "$VERBOSITY" = "1" ]; then
56 echo "$WPA_SUP_PNAME: ctrl_interface socket located at $WPA_COMMON_CTRL_IFACE/$IFACE"
63 elif [ "$MODE" = "stop" ]; then
65 if [ -f "$WPA_SUP_PIDFILE" ]; then
67 if [ "$VERBOSITY" = "1" ]; then
68 echo "$WPA_SUP_PNAME: terminating $WPA_SUP_PNAME daemon"
71 start-stop-daemon --stop --quiet \
72 --name $WPA_SUP_PNAME --pidfile $WPA_SUP_PIDFILE
74 if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
75 rm -f $WPA_COMMON_CTRL_IFACE/$IFACE
78 if [ -f "$WPA_SUP_PIDFILE" ]; then
79 rm -f $WPA_SUP_PIDFILE