954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Logging into a page automatically using shell script.

My college has Cyberoam software installed at the server. So, we need to visit its page and login there before we can use the internet. The problem is that we need to keep the page of Cyberoam (into which we logged in) open. If we close that then our net won't work. The Cyberoam page seems to refresh itself every 3 mins. Keeping a full-fledged browser open just to stay online on (say) Google Talk is painful.

I would like to make a shell script (using lynx or elinks or any command line tool) which when executed will automatically visit my given page and login there using my given username and passwords and will run in background, hidden and out of sight.

How do I do that???:?:

applegrew
Newbie Poster
5 posts since May 2007
Reputation Points: 25
Solved Threads: 0
 

Prabably this login system uses sessions. If the login form use GET instead of POST you can try to build a link to log into the restricted area, from lynx (links or w3m). You need to look the form structure in order to know if there is any kind of hidden input that can block your login script.

If the form is simple, then, you can build a link with your username and password, something like this:

lynx <a href="http://server/login.script?user=yourUser&pass=yourPass">http://server/login.script?user=yourUser&pass=yourPass</a>

Obviously, if that works, you can't close lynx otherwise you will lost your session. Bye :)

cereal
Master Poster
708 posts since Aug 2007
Reputation Points: 214
Solved Threads: 119
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You