From 06f6fab07786329be1d4b03a09c5af177cadd609 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sun, 13 Sep 2009 23:43:41 -0400 Subject: revert regexp ESSID patches Signed-off-by: Jim Pryor --- src/wireless | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src/wireless') 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 -- cgit v1.2.3-24-g4f1b