summaryrefslogtreecommitdiffstats
path: root/src-wireless
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-08-11 14:05:15 +0200
committerJames Rayner <james@archlinux.org>2009-08-15 04:28:30 +0200
commit07aa8f784896ba97914f4b2a71d2ba6c0047cb07 (patch)
tree0889fa8f1d5ec240edd4ac3fd75ab59cefcf86f3 /src-wireless
parent6c5e4f9ab4f75adfdd1949f929bf6a2308ecd03b (diff)
downloadnetctl-07aa8f784896ba97914f4b2a71d2ba6c0047cb07.tar.gz
netctl-07aa8f784896ba97914f4b2a71d2ba6c0047cb07.tar.xz
extend set_interface usage to netcfg-auto-wireless
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src-wireless')
-rw-r--r--src-wireless/netcfg-auto-wireless9
1 files changed, 6 insertions, 3 deletions
diff --git a/src-wireless/netcfg-auto-wireless b/src-wireless/netcfg-auto-wireless
index aa2590f..24edcfb 100644
--- a/src-wireless/netcfg-auto-wireless
+++ b/src-wireless/netcfg-auto-wireless
@@ -9,13 +9,14 @@
# $1 - wireless interface
wifi_auto()
{
- interface=$1;
+ local interface="$1"
report_try "Scanning for networks"
- ifconfig $interface up
+ set_interface up "$interface" # uses iproute methods---is it there any value to providing option to use ifconfig?
networks="$(list_networks $interface)"
if [[ ! "$networks" ]]; then
+ set_interface forcedown "$interface"
exit_fail "- No networks available."
fi
@@ -66,9 +67,11 @@ wifi_auto()
if profile_up "$found_profile" "$found_essid"; then # JP: now we pass literal essid to profile_up as $2
exit 0
else
+ set_interface forcedown "$interface"
exit_fail "Couldn't connect profile $found_profile."
fi
else
+ set_interface forcedown "$interface"
exit_fail "No profiles matched the local networks."
fi
@@ -81,4 +84,4 @@ if [[ -z $1 ]]; then
exit_stderr "Please supply an interface to connect"
fi
wifi_auto $1
-
+