Assorted away-tpope updates
[tpope-extra.git] / if-up.d / bluesocket
1 #!/bin/sh
2 # Author: Tim Pope
3 # Automatically logs in as a guest to bluesocket for wireless network access.
4 # This particular version is tailored for my college, and only launches if
5 # the local ip address is on the subnet used there.
6
7 # PLEASE CHANGE EMAIL ADDRESS BEFORE USING!
8 [ "`hostname`" != lisa ] || email="nvcwireless%40rebelongto.us"
9 #email=your-email-address-here
10
11 if [ -z "${1:-$IFACE}" ] || /sbin/ifconfig "${1:-$IFACE}"|grep -qs 'inet addr:10\.0\.1[45]'; then
12     /usr/bin/curl -k 'https://10.12.0.210/login.pl' --data '_FORM_SUBMIT=1' --data 'which_form=guest' --data 'destination=http%3A//www.google.com/' --data 'source=10.12.0.240' --data "bs_email=`echo $email|sed -e 's/@/%40/'`" >/dev/null 2>&1
13 fi