From 3b2636322f4d72af1d5485baf2bdfb8d59077c7b Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sun, 13 Sep 2009 23:43:39 -0400 Subject: remove duplicated list_networks Signed-off-by: Jim Pryor --- src/wireless | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/src/wireless b/src/wireless index d118919..cab017e 100644 --- a/src/wireless +++ b/src/wireless @@ -84,46 +84,6 @@ find_ap() { # Return a filename containing a list of network APs and ESSIDs found (sorted by decreasing signal strength) # list_networks interface -list_networks() -{ - local INTERFACE="$1" essids - # temp file used, as keeping ESSID's with spaces in their name in arrays - # is hard, obscure and kinda nasty. This is simpler and clearer. - - [[ -z "$INTERFACE" ]] && return 1 - essids=$(mktemp --tmpdir essid.XXXXXXXX) - - - wpa_supplicant -B -i$INTERFACE -Dwext -C/var/run/wpa_supplicant -P/var/run/wpa_supplicant.pid - wpa_cli -i "$INTERFACE" scan &> /dev/null - sleep 2.5 - wpa_cli -i "$INTERFACE" scan_results | - grep -v "^Selected" | - grep -v "^bssid" | - sort -rn -k3 | - sort -u -k5 | - sort -rn -k3 | - cut -f1,5 > "$essids" - - # Fields are tab delimited - # Remove extraneous output from wpa_cli - # Sort by strength - # Remove duplicates - # Re-sort by strength as the removal disorders the list - # Cut to the AP/essid fields only - - kill $(cat /var/run/wpa_supplicant.pid) - - # File of 0 length, ie. no ssid's. - if [[ ! -s "$essids" ]]; then - rm -f "$essids" - return 1 - fi - - echo $essids - return 0 -} - list_networks() { wpa_supplicant_scan_info "$1" 1,5 } -- cgit v1.2.3-24-g4f1b