summaryrefslogtreecommitdiffstats
path: root/src/wireless
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-09-14 05:43:41 +0200
committerJames Rayner <james@archlinux.org>2009-09-14 08:24:48 +0200
commit06f6fab07786329be1d4b03a09c5af177cadd609 (patch)
treebd9cb2c57963cc77cd1e68701fe6bd3d3567f448 /src/wireless
parentf2da81ef36dcce8cfd4b841ca1677e744818b3be (diff)
downloadnetctl-06f6fab07786329be1d4b03a09c5af177cadd609.tar.gz
netctl-06f6fab07786329be1d4b03a09c5af177cadd609.tar.xz
revert regexp ESSID patches
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/wireless')
-rw-r--r--src/wireless26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/wireless b/src/wireless
index 1292281..2a5b4a3 100644
--- a/src/wireless
+++ b/src/wireless
@@ -14,28 +14,18 @@ wep_check()
}
# Check if a particular network is within range
-# find_essid interface essid connection (we treat ESSID as regexp when CONNECTION=wireless-dbus)
+# find_essid interface essid connection
find_essid() {
- local INTERFACE="$1" ESSID="$2" CONNECTION="$3" RETRIES=10 try=0 res scanned
+ local INTERFACE="$1" ESSID="$2" RETRIES=10 try=0 res scanned
while [[ "$try" -lt "$RETRIES" ]]; do
sleep 0.5
let try++
- if [[ "$CONNECTION" == wireless-dbus ]]; then
- # JP: ESSID is a regexp
- found=$(
- res=$(iwlist "$INTERFACE" scan 2>/dev/null)
- [[ -z "$res" ]] && exit 1
- # if results were non-null, process them and exit 0
- echo "$res" | sed -nr 's/^\s+ESSID:"([^"]*)"$/\1/p' | egrep -xm1 "$ESSID"
- )
- else
- found=$(
- res=$(iwlist "$INTERFACE" scan 2>/dev/null)
- [[ -z "$res" ]] && exit 1
- # if results were non-null, process them and exit 0
- echo "$res" | sed -nr 's/^\s+ESSID:"([^"]*)"$/\1/p' | fgrep -xm1 "$ESSID"
- )
- fi && {
+ found=$(
+ res=$(iwlist "$INTERFACE" scan 2>/dev/null)
+ [[ -z "$res" ]] && exit 1
+ # if results were non-null, process them and exit 0
+ echo "$res" | sed -nr 's/^\s+ESSID:"([^"]*)"$/\1/p' | fgrep -xm1 "$ESSID"
+ ) && {
scanned=1
report_debug find_essid "\"$found\""
# we only bother with at most 5 successful scans