From 42000150fef1f87e518bc6fc162e83ee902dfcd5 Mon Sep 17 00:00:00 2001 From: Sebastian Wicki Date: Thu, 18 Feb 2010 20:19:04 +0100 Subject: [PATCH] Fix net-auto-wireless with hardware kill switch --- wpa_actiond/netcfg-wpa_actiond | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wpa_actiond/netcfg-wpa_actiond b/wpa_actiond/netcfg-wpa_actiond index ea0945f..06384b8 100755 --- a/wpa_actiond/netcfg-wpa_actiond +++ b/wpa_actiond/netcfg-wpa_actiond @@ -15,7 +15,7 @@ case $1 in stop) stop_wpa $2 kill $(cat "/var/run/wpa_actiond_${2}.pid") - if [[ -n "$RFKILL" ]]; then # Enable radio if necessary + if [[ "$RFKILL" == "soft" ]]; then # Disable radio if necessary set_rf_state "$interface" down || exit $? fi exit @@ -40,7 +40,15 @@ if [[ -f "$CONN_DIR/interfaces/$interface" ]]; then fi if [[ -n "$RFKILL" ]]; then # Enable radio if necessary - set_rf_state "$interface" up || exit $? + state=$(get_rf_state "$interface") || exit $? + if [[ "$state" != "enabled" ]]; then + if [[ "$RFKILL" == "soft" ]]; then + set_rf_state "$interface" up || exit $? + else + report_fail "radio is disabled on $interface" + exit 1 + fi + fi fi WPA_CONF="$(make_wpa_config_file $interface)" -- 1.6.6.1