Skip to content

Instantly share code, notes, and snippets.

Created February 14, 2017 18:06
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Auto re-connect to Nova Arcada's Free Wi-fi
#!/usr/bin/env bash
# TODO: wait for no Internet connection to run this script
set -x
while true
ABC=$(curl -L -I | grep '^Location' | awk '{print $2}' | grep -o 'loginurl=.*$' | cut -d'=' -f2)
export ABC="$ABC"
DEF=$(python2 -c 'import urllib2; import os; print urllib2.unquote(os.environ["ABC"])')
sleep 1
GHI=$(curl "$DEF" | sed ':a;N;$!ba;s/\n//g' | grep -Po '(?<=<a id="button" href=")[^"]*')
sleep 1
JKL=$(curl -I "$GHI" | grep -o 'url=.*' | cut -d'=' -f2-)
sleep 1
curl "$JKL"
sleep 10m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment