Notices


Reply
Thread Tools
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#1
Doesn't really fit into Applications, but some might find useful.

Not sure if this is world-popular feature, but a couple of avenues I frequent have free wifi access that needs reactivation every now and then (30 or 60 minutes) with a password that changes daily. Even though the method seems to be POST, just opening url of the login.php/welcome.php page with '?passkey=xyz' doesn't seem to work. Cookies might be the reason, not sure. Here is automated script that works.

Requires lynx (sudo apt-get install lynx).
Change url to the one used by your pub (address of the page that shows up asking for password, in the example: http://url.goes.here/welcome.php).
Check source of the page for the name of the element that gets posted (in my example it is 'passkey', save welcome page, open .html with editor and look for <form method="post" action="welcome.php"> element, after that should be element: name="this_is_it" type="text" - this will_be_it if the login page uses POST, if not, this won't work) and adjust accordingly.
If needed, fix timing in the watch line ('watch -n 1805' means command will be repeated after 1805 seconds or 30 minutes and 5 seconds as was the case, 3605 should work for 1h timeout, 5 seconds being there just in case there is lagging response).
Place the script in ext2/3 partition like /home/user/ for example, make it executable (chmod +x autorelog.sh) and once you get password from the bartender just run the script once and leave it running in the background (./autorelog.sh password). Alternatively you can run it from MyDocs with sh command (place in MyDocs, open xterm, cd MyDocs, sh autorelog.sh password).
Enjoy no more problems with trying to remember what the password was after 30/60 minutes.
Attached Files
File Type: gz autorelog.tar.gz (248 Bytes, 60 views)
 

The Following User Says Thank You to szopin For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:56.