Skip to content

Instantly share code, notes, and snippets.

@timabell
Created October 14, 2013 17:21
Show Gist options
  • Select an option

  • Save timabell/6978958 to your computer and use it in GitHub Desktop.

Select an option

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.
#!/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