Created
October 14, 2013 17:21
-
-
Save timabell/6978958 to your computer and use it in GitHub Desktop.
See the ping times for all the access points with a single ssid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| SSID=$1 | |
| echo Checking access points for ssid $SSID ... | |
| AP_LIST=`sudo iwlist wlan0 scan essid $SSID | grep "Address" | awk '{print $5}'` | |
| echo Found access points: | |
| echo $AP_LIST | |
| for ap in $AP_LIST | |
| do | |
| echo Connecting to $ap ... | |
| sudo wpa_cli -i wlan0 bssid 0 $ap | |
| sudo wpa_cli -i wlan0 reassociate | |
| sudo wpa_cli -i wlan0 status | |
| ping -c 10 -s 1024 ic.ac.uk | |
| echo -n | |
| done | |
| echo done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment