Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to automatically reconnect to the net' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to automatically reconnect to the net
Authored by: T0Bi on Apr 09, '06 04:13:17AM

You could use CURL (http://curl.mirror.at.stealer.net/docs/httpscripting.html
) to do a POST.

curl -d "user=username&password=mypassword" www.hotmail.com/login.cgi

If you use e.g. wget (install via fink) to test if there ist still a internet connection - like in this script i just found by googling - you can run it continuously. This script takes also care of https and cookies if needed.
-------
[code]
#!/bin/bash
# Script to auto-login to UMN Resnet
#
# Written by Matthew Beckler beck0778@umn.edu

USERNAME=beck0778
PASSWORD=password
COOKIEJAR='/tmp/resnet-cookie'

wget http://www.google.com/ -O /dev/null &> /dev/null
if [[ $? = 1 ]]; then
#could not access google.com - time to login
curl https://resnet.netsec.umn.edu/fall2005/?original=http://www.google.com/ -F username=$USERNAME -F password=$PASSWORD -c $COOKIEJAR -L -o /dev/null &> /dev/null
#waiting 30-120 seconds - you might want to adjust this
sleep 30
#finalize the login
curl https://resnet.netsec.umn.edu/fall2005/ -b $COOKIEJAR -L -o /dev/null &> /dev/null
fi

exit 0
[/code]
--------



[ Reply to This | # ]