Return to Snippet

Revision: 3649
at August 28, 2007 15:44 by scyclops


Initial Code
import sys, getpass, urllib

separator = "-----------------------------"
print(separator + 
       "\n   Georgia Tech Lawn Login\n" + 
       separator)

if len(sys.argv) >= 2:
    username = sys.argv[0]
    password = sys.argv[1]
    if len(sys.argv) >= 3:
        iss = sys.argv[2]
    else:
        iss = ""
else:
    username = raw_input("Username: ")
    password = getpass.getpass()
    iss = raw_input("Enable Inbound Security? ")

if iss.strip() in ("", "true", "True", "1", "y", "Y", "yes", "Yes"):
    iss = "true"
else:
    iss = "false"

try:
    print "\nAttempting to login..."
    data = urllib.urlopen('https://auth.lawn.gatech.edu/index.php',
                           'username=' + username +
                           '&password=' + password +
                           '&iss=' + iss +
                           '&output=text')
    print separator
    print data.read()
except IOError, e:
    print "IOError:", e

Initial URL
http://andrewtrusty.com/

Initial Description
A quick and simple script to allow people to log onto the Georgia Tech wireless network without opening a browser.  Pass your login details on the command line or enter them once you run the script.

Sources:
- http://www.lawn.gatech.edu/help/command_line.html

Initial Title
Georgia Tech LAWN login script

Initial Tags


Initial Language
Python