Skip to content

Instantly share code, notes, and snippets.

@austindoeswork
Created March 2, 2016 19:47
Show Gist options
  • Save austindoeswork/d9f13409d81d8cd6656c to your computer and use it in GitHub Desktop.
Save austindoeswork/d9f13409d81d8cd6656c to your computer and use it in GitHub Desktop.
#!/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