Friday, October 7, 2011

Script to connect to HunterNet


The connection to my university wifi is terrible and requires authentication. I have written a small script here which allows me to connect to the internet without a browser. 


#!/bin/bash


IP=$(ip addr show wlan0 | grep inet | head -n1 | cut -f6 -d ' '| cut -f1 -d '/')
MAC=$(ip addr show wlan0 | grep link | head -n1 | cut -f6 -d ' ')


echo $IP;
echo $MAC;
echo `curl -d "user=USERNAME&password=PASSWORD" https://securelogin.arubanetworks.com/cgi-bin/login?cmd=login&mac=$MAC&ip=$IP`


echo "CONNECTED!"

No comments:

Post a Comment