Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # One may need to change this as well. This is the code for Italy
- COUNTRY=VF_IT
- # The URL uses "%40" for "@". We do the same
- USERNAME=<your username>%40<your domain>
- PASSWORD=<your password>
- while [ true ]
- do
- ifconfig en0 | grep "inactive" || wget -qO- http://captive.apple.com/hotspot-detect.html 2>&1 | grep 'Success' > /dev/null
- if [ $? != 0 ]; then
- #
- # if Captive Network Assistant app launches, for some reason DNS doesn't work.
- # Just kill it
- killall -9 "Captive Network Assistant" 2>&1 > /dev/null
- # The challenge number seems to change at each connection. Grab it
- # Grab it querying an IP number in case DNS isn't active.
- CHALLENGE=$(wget 8.8.8.8 2>&1 | grep challenge | awk -F= '{ print $7 }' | tail -1 | awk -F& '{ print $1 }')
- # Just for debug purposes
- # echo challenge is $CHALLENGE
- # I have changed the **nasid** and **mac numbers** for security reasons
- # I believe one should use their own anyway.
- wget --save-cookies cookiejar --keep-session-cookies
- --post-data "chooseCountry=$COUNTRY%2F&userFake=$USERNAME$&UserName=$COUNTRY%2F$USERNAME&Password=$PASSWORD&_rememberMe=on"
- "https://it.portal.vodafone-wifi.com/jcp/it?res=login&nasid=90-35-6E-E8-E1-60&uamip=192.168.6.1&uamport=80&mac=F4-5B-89-83-00-2D&challenge=$CHALLENGE"
- 2> /dev/null
- fi
- sleep 10
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement