Created
March 2, 2016 19:47
-
-
Save austindoeswork/d9f13409d81d8cd6656c to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
# setup rpi wifi | |
sudo killall wpa_supplicant dhcpcd >/dev/null 2>&1 | |
sleep 2 | |
echo "logging into eduroam..." | |
wpa_supplicant -i wlp2s0 -B -c /etc/wpa_supplicant/wpa_supplicant.conf | |
sleep 1 | |
echo -en "\r[* ]" | |
sleep 1 | |
echo -en "\r[** ]" | |
sleep 1 | |
echo -en "\r[*** ]" | |
sleep 1 | |
echo -en "\r[**** ]" | |
dhcpcd >/dev/null 2>&1 | |
sleep 1 | |
echo -en "\r[*****]\n" | |
wget -q --tries=10 --timeout=20 --spider http://google.com | |
if [[ $? -eq 0 ]]; then | |
echo "we haz interwebs" | |
else | |
echo "no can haz interwebs, retrying..." | |
sleep 1 | |
rpi_wifi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment