diff options
author | James Rayner <james@archlinux.org> | 2009-09-27 16:37:22 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-27 16:37:22 +0200 |
commit | 83ad2000a37e6e2f2bf658553c7997c7f03459d1 (patch) | |
tree | 5d8a0c3532b2064f1f018e7dce7b0966766def42 | |
parent | df2c2b5c04393ed72c2798407f50f99a6298b673 (diff) | |
download | netctl-83ad2000a37e6e2f2bf658553c7997c7f03459d1.tar.gz netctl-83ad2000a37e6e2f2bf658553c7997c7f03459d1.tar.xz |
Add stop to netcfg-wpa_actiond, default to WPA2, then WPA.
-rw-r--r-- | src/8021x | 4 | ||||
-rwxr-xr-x | wpa_actiond/netcfg-wpa_actiond | 26 |
2 files changed, 22 insertions, 8 deletions
@@ -76,9 +76,9 @@ make_wpa_config() { ;; wpa) if [[ "${#KEY}" -eq 64 ]]; then - echo "ssid=\"$ESSID\" \npsk=$KEY" + echo "proto=RSN WPA\n ssid=\"$ESSID\" \npsk=$KEY" else - echo "ssid=\"$ESSID\" \npsk=\"$KEY\"" + echo "proto=RSN WPA\n ssid=\"$ESSID\" \npsk=\"$KEY\"" fi ;; wpa-configsection) 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 <interface>" + echo "netcfg-wpa_actiond stop <interface>" + 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 |