Skip to main content

Thread: Automatic logon to internet using scripts


hello all.
i'm working in france right now. , internet access through router on local network (lan) of hotel in stay. in order have internet access must type in room number, name, check agreement , click enter.
problem router cuts off internet every 2 hours.
need script followings:
- detect if there no more internet connection (the lan connection stays on)
- if there isn't run script things above.
i've managed script puts room number, name, check agreement , click enter using dejaclick, making bookmark , open firefox , run script.
command i've used in terminal , think can use in script was:
firefox dejaclick:///home/username/.mozilla/firefox/hex2xi8w.default/dejaclick/recordings/wifilogon.xml
works well. it's connecting net.
remains detection of cut off of internet connection.
tried wicd, going properties of wireless connection , on script. here i'm stucked... don't know anymore.it has post-disconnection script option, lan connection not disconnecting, internet access through lan disconnecting.
can guide me please?
in advance.
i'm ubunter , i'm happy it.

what want put sleep loop in script ping or wget access site. test return result , continue sleep if ok, , connect if not. loop again on whole thing.

start script background process using scriptname& continues run.

method starting connection awkward. @ form login , put wget command in script login post/get request.

eg. easier,
(this example, actual values in login form on login page)

wget http://hotelsite/login-page?room=234&pwd=1234

untested example script might be,

code:
#!/bin/bash  while true;  while true; wget google.com if [ $? -ne 0 ]; break fi sleep 60 done;  wget hhtp://hotel-login-page-url?room=etc  done;
that's off top of head, needs debugging, testing.

tests reaching google , if sleeps 60 seconds. if failed request re-login.
, returns first loop.

if call script keep connected , chmod 770 run this,

if login form uses post instead of need modify login wget command use --post-data=... instead of example. anyway, can tested command line see if works.
./hotelconnect&

, kill this,

pkill hotelconnect

can make desktop shortcuts both cases.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Networking & Wireless [ubuntu] Automatic logon to internet using scripts


Ubuntu

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい