summaryrefslogtreecommitdiffstats
path: root/src-wireless/netcfg-auto-wireless
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-09-07 14:29:56 +0200
committerJames Rayner <james@archlinux.org>2009-09-07 14:29:56 +0200
commit820d9295b51e427f3e17c9e83227a127ef9b7631 (patch)
tree7e33c460e11590348dd1312b3168dd83789212a9 /src-wireless/netcfg-auto-wireless
parent24d48b93ab76e255145edf097ebcb84ba70d5cb1 (diff)
downloadnetctl-820d9295b51e427f3e17c9e83227a127ef9b7631.tar.gz
netctl-820d9295b51e427f3e17c9e83227a127ef9b7631.tar.xz
Rework rfkill into re-usable functions
Diffstat (limited to 'src-wireless/netcfg-auto-wireless')
-rw-r--r--src-wireless/netcfg-auto-wireless10
1 files changed, 8 insertions, 2 deletions
diff --git a/src-wireless/netcfg-auto-wireless b/src-wireless/netcfg-auto-wireless
index 5bf0e5a..e83f55b 100644
--- a/src-wireless/netcfg-auto-wireless
+++ b/src-wireless/netcfg-auto-wireless
@@ -11,6 +11,12 @@ wifi_auto()
{
local interface="$1"
report_try "Scanning for networks"
+ source $IFACE_DIR/$interface
+
+ if [[ $RFKILL ]]; then
+ set_rf_state $interface up
+ fi
+
set_interface up "$interface" # uses iproute methods---is it there any value to providing option to use ifconfig?
networks="$(list_networks $interface)"
@@ -60,7 +66,7 @@ wifi_auto()
done < <(list_profiles) # avoid subshell we'd get by piping list_profiles to while read
done < "$networks" # avoid subshell; list_networks returns name of a tmp file
rm -f "$networks" # shouldn't we delete the tmp file?
-
+
if [[ -n "$found_profile" ]]; then
report_success
if profile_up "$found_profile" "$found_essid"; then # JP: now we pass literal essid to profile_up as $2
@@ -73,7 +79,7 @@ wifi_auto()
set_interface forcedown "$interface"
exit_fail "No profiles matched the local networks."
fi
-
+
}
if [[ $(id -u) -ne 0 ]]; then