diff options
author | Rémy Oudompheng <remy@archlinux.org> | 2011-06-19 17:55:21 +0200 |
---|---|---|
committer | Rémy Oudompheng <remy@archlinux.org> | 2011-06-19 18:49:26 +0200 |
commit | 180fbf1d82f97329be645699e89c0ee599cbf9f2 (patch) | |
tree | 63cd6271cdaab3bb8951b55ad0f91e30c6ee6723 /src/wireless | |
parent | ae967f278e150f83f4d3e05eae789ee0f0cfc8f0 (diff) | |
download | netctl-180fbf1d82f97329be645699e89c0ee599cbf9f2.tar.gz netctl-180fbf1d82f97329be645699e89c0ee599cbf9f2.tar.xz |
Remove now unused functions find_ap() and find_essid()
Diffstat (limited to 'src/wireless')
-rw-r--r-- | src/wireless | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/wireless b/src/wireless index b5ae141..85743bf 100644 --- a/src/wireless +++ b/src/wireless @@ -13,65 +13,6 @@ wep_check() return 1 } -# Check if a particular network is within range -# find_essid interface essid connection -find_essid() { - local INTERFACE="$1" ESSID="$2" RETRIES=10 try=0 res scanned - while [[ "$try" -lt "$RETRIES" ]]; do - sleep 0.5 - let try++ - 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 - if (( try < RETRIES-4 )); then try=$((RETRIES-4)); fi - } - if [[ -n "$found" ]]; then - echo "$found" # JP: echo literal ESSID - return 0 # network found - fi - done - if [[ "$scanned" -ne 1 ]]; then - report_debug find_essid "unable to scan" - fi - return 1 -} - -# Check if a particular network is within range -# find_ap interface ap -find_ap() { - local INTERFACE="$1" ap=$(echo "$2" | tr 'abcdef' 'ABCDEF') RETRIES=10 try=0 res scanned - while [[ "$try" -lt "$RETRIES" ]]; do - sleep 0.5 - let try++ - 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+Cell .. - Address: ([[:xdigit:]:]+)$/ { s//\1/; N; s/(.*)\n\s+ESSID:"([^"]*)"$/\1\t\2/p }' \ - | egrep -m1 "^$ap\t" - ) && { - scanned=1 - report_debug find_ap "\"$found\"" - # we only bother with at most 5 successful scans - if (( try < RETRIES-4 )); then try=$((RETRIES-4)); fi - } - if [[ -n "$found" ]]; then - echo "$found" | cut -f2 # JP: echo literal ESSID - return 0 - fi - done - if [[ "$scanned" -ne 1 ]]; then - report_debug find_ap "unable to scan" - fi - return 1 -} - set_rf_state() { local INTERFACE="$1" state="$2" RFKILL_NAME="$3" |