Posts Tagged ‘internet’
Posted on January 5, 2010 - by Sarath
Asianet dataline internet autoconnect script
In my hostel, we use asianet dataline internet connection. The connection is established through a webpage authentication and it needs to keep that webpage always open in the browser to get the stable connection. Once we login and releave that page, after five minutes it will require a re-login. Its a real hurdle to keep a page open in the browser for internet authentication.
I just analyzed the http requests from that page and automated using the curl utility.
Here is the script it feel, it would be useful for many.
customer=CNXXXX
password=XXXXXX
if [ -n "`ifconfig | grep -A 1 wlan0 | grep "inet addr"`" ];
then
curl https://mwcp-ekm-04.adlkerala.com:8001 --data "auth_user=$customer&auth_pass=$password&accept=Login" &> /dev/null
echo "Connected :)"
while true
do
sleep 300
curl https://mwcp-ekm-04.adlkerala.com:8001 --data "alive=y&un=$customer" &> /dev/null ;
done
else
echo "Wifi not connected";
fi
Copy down the above script in a text file and rename to internet.sh
slynux@slynux-laptop:~$ ./internet.sh
Connected :)
This script has an initial check for ethernet interface. Here it is given Wifi interface, wlan0. If you use a LAN for connection change wlan0 to eth0 and the message as well
Posted on July 23, 2008 - by Sarath
Hacking BSNL EVDO Internet.
and respective connection model device will be /dev/ttyUSB0
I felt like its a kinda frustration to configure it manually by GNU/Linux users and I’m afraid of users going back to M$ Windows and use that default application. This leveraged me to write a device installer script.
Download this script [DOWNLOAD] and go for a one command install.
As root run,
# sh bsnl_evdo.sh
Finally it works fine.
I am getting a download speed around 9 – 15 kbps. But, truly speaking the connection speed flows between bytes and kilobytes Anyway I didn’t get enough time to play around with it to optimise speeds.

Solve real-world shell scripting problems with over 110 simple but incredibly effective recipes.

