Created
August 7, 2012 08:28
-
-
Save barak/3283218 to your computer and use it in GitHub Desktop.
Trivial script to log in to Colorado State University (CSU) guest WiFi system instead of manual laborious form filling.
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/sh | |
set -e | |
# Set these appropriately. I had two, so I made a way to get either. You probably only need one. | |
case "${1}" in | |
d*) | |
user="vpsa22638" | |
password="A34ks52f" | |
;; | |
c*|*) | |
user="vpsa44314" | |
password="W74x4bcb" | |
;; | |
esac | |
echo "user: ${user}" | |
form="https://arubamaster.colostate.edu/auth/index.html/u" | |
outfile="/tmp/netlogin-$$.html" | |
curl --progress-bar --output "${outfile}" \ | |
--insecure \ | |
--data "user=${user}" \ | |
--data "password=${password}" \ | |
"${form}" | |
if [ -e "${outfile}" ]; then | |
echo Result: | |
lynx -dump "${outfile}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment