From 83ad2000a37e6e2f2bf658553c7997c7f03459d1 Mon Sep 17 00:00:00 2001 From: James Rayner Date: Mon, 28 Sep 2009 00:37:22 +1000 Subject: Add stop to netcfg-wpa_actiond, default to WPA2, then WPA. --- wpa_actiond/netcfg-wpa_actiond | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'wpa_actiond/netcfg-wpa_actiond') diff --git a/wpa_actiond/netcfg-wpa_actiond b/wpa_actiond/netcfg-wpa_actiond index 02901c6..1242a73 100755 --- a/wpa_actiond/netcfg-wpa_actiond +++ b/wpa_actiond/netcfg-wpa_actiond @@ -1,14 +1,28 @@ - +#! /bin/bash . /usr/lib/network/network . /usr/lib/network/8021x . /usr/lib/network/wireless -interface=$1; shift - AUTOWIFI="/usr/sbin/wpa_actiond" ACTION_SCRIPT="/usr/bin/netcfg-wpa_actiond-action" -PIDFILE="/var/run/wpa_supplicant_${interface}.pid" -EXTRA_AUTOWIFI_OPTIONS="$*" +PIDFILE="/var/run/wpa_actiond_${interface}.pid" + +case $1 in + help) + echo "netcfg-wpa_actiond " + echo "netcfg-wpa_actiond stop " + exit + ;; + stop) + stop_wpa $2 + kill $(cat $PIDFILE) + exit + ;; + *) + interface=$1; shift + EXTRA_AUTOWIFI_OPTIONS="$*" + ;; +esac if [[ -z $interface ]]; then echo "No interface specified" @@ -45,7 +59,7 @@ done stop_wpa "$interface" if start_wpa $interface $WPA_CONF $WPA_DRIVER $WPA_OPTS; then - if $AUTOWIFI -i ${interface} -P {PIDFILE} -a ${ACTION_SCRIPT} ${EXTRA_AUTOWIFI_OPTIONS}; then + if $AUTOWIFI -i ${interface} -P ${PIDFILE} -a ${ACTION_SCRIPT} ${EXTRA_AUTOWIFI_OPTIONS}; then exit 0 fi fi -- cgit v1.2.3-24-g4f1b