From 77a2e3798ce3197146315754e813e2b902f3f0b5 Mon Sep 17 00:00:00 2001 From: James Rayner Date: Sat, 7 Nov 2009 11:56:09 +1100 Subject: Prevent corrupting wpa-config WPA_CONF, rfkill on stop --- wpa_actiond/netcfg-wpa_actiond | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wpa_actiond/netcfg-wpa_actiond b/wpa_actiond/netcfg-wpa_actiond index 32fd42d..a582353 100755 --- a/wpa_actiond/netcfg-wpa_actiond +++ b/wpa_actiond/netcfg-wpa_actiond @@ -15,6 +15,9 @@ case $1 in stop) stop_wpa $2 kill $(cat "/var/run/wpa_actiond_${2}.pid") + if [[ -n "$RFKILL" ]]; then # Enable radio if necessary + set_rf_state "$interface" down || exit $? + fi exit ;; *) @@ -32,6 +35,10 @@ fi # Load interface specific config [[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface" +if [[ -f "$CONN_DIR/interfaces/$interface" ]]; then + netcfg -i $interface +fi + if [[ -n "$RFKILL" ]]; then # Enable radio if necessary set_rf_state "$interface" up || exit $? fi @@ -45,9 +52,11 @@ for profile in $(list_profiles); do [[ $CONNECTION != "wireless" ]] && exit 1 [[ $INTERFACE != $interface ]] && exit 1 - + # Exclude wpa-config, the wpa_conf is 'complete' and doesn't fit in this scheme + [[ $SECURITY == "wpa-config" ]] && exit 1 + config=$(make_wpa_config) - + echo -e "network={ \n$config \nid_str=\"$profile\" \n}" >> $WPA_CONF ) done -- cgit v1.2.3-24-g4f1b