Posted: Sat Jul 23, 2011 2:49 Post subject: AutoLogin Script
My internet requires me to login every two hours. The page opens and requests for a username and password and then click on a submit button. This is not a typical pppoe connection. This for hathway broadband.
I have a netgear router that is ddwrt capable. appreciate your help greatly.
You can use wget to login into this page. Just open the page source and search for the post fields.
e.g:
<input type="password name="password"/>
<input type="text" name="username"/>
...
than use wget to login into the page:
wget -O - --save-cookies /tmp/cookies.txt \
--post-data 'username=foo&password=bar' \
http://your-strange-login-host.com
It will output the target page, so you will know if it worked or not. After that i would add "2>&1 > /dev/null" to the end of the command to suppress output. Just create a simple shellscript and add the command. Then use cron to call the script every 1h or so. You can add cron task with the webgui -> Administration -> Additional Cron Jobs. For a task that gets called every hour use:
But, the busybox wget doesnt support the cookie options and I can't use ipkg because it doesn't work properly with my tiny jffs as my router (Linksys E1000) doesn't have enough flash.
Posted: Wed Sep 12, 2012 21:31 Post subject: So far I got last time (and still blocked) ....
For the fon in belgium (belgacomfon) these commands work from a commandline on a pc connected to the box.
However, I could not manage to get my TL-WR740N box to execute itselves these commands (basically because I couldn't get wget on the TL-WR740N and it has no free memory to store the script on ...)
Posted: Sun Feb 09, 2014 2:23 Post subject: Scripts for FON in Portugal (ZON)
GeeVee, thanks for the wget commands. Based upon them I was able to create scripts to auto login in FON in Portugal. They were tested in OpenWRT using the wget package with SSL. wget-nossl or the small wget in BusyBox lack some required options.
The scripts are crafted for hotplug in order to be run when the wireless interface is set up or updated.
For FON_ZON_FREE_INTERNET:
Code:
etc/hotplug.d/iface/99-login-zon
Code:
#!/bin/sh
if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies http://search.yacy.net
POST_URL=$(cat portal.html | grep 'action="https://zon' | cut -d \" -f 4)
if [ -n "$POST_URL" ]; then
wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=<your_email>&PASSWORD=<your_pswd>&remember=on" $POST_URL
fi
rm cookie portal.html
fi
For FON_FREE_INTERNET (from original FON routers):
Posted: Tue Mar 18, 2014 0:49 Post subject: Re: Scripts for FON in Portugal (ZON)
dllud wrote:
GeeVee, thanks for the wget commands. Based upon them I was able to create scripts to auto login in FON in Portugal. They were tested in OpenWRT using the wget package with SSL. wget-nossl or the small wget in BusyBox lack some required options.
The scripts are crafted for hotplug in order to be run when the wireless interface is set up or updated.
For FON_ZON_FREE_INTERNET:
Hi.
Im trying to get this script running a fonera 2201 with dd-wrt. But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"
I downloaded some vers for FON atheros based, over open-wrt ipk package repo, but no success at all, what was the version of openwrt did you tested that script ?
Boas, tambem sou tuga, e ando por aqui a ver se consigo por isso a funcionar. qq ajuda agradecia
Posted: Wed Mar 26, 2014 15:29 Post subject: Re: What if I dont have GNU wget
dllud wrote:
arssant wrote:
But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"
shaan7 wrote:
the busybox wget doesnt support the cookie options
Thus you have to install the full wget using ipkg (DD-WRT) or opkg (OpenWrt).
Hi.
Success, with fon ZON ( Portugal )
I used a fon2201. Ironical, it was originally provided from FON for ZON ISP customers.
But worked with openwrt backfire 10.03.1.
With dd-wrt got issue, as Buss error when running wget. I tried all packages from openwrt ( kamikase, backfire, even adjustment )
One thing I need to fix, only got firsts 11 channels available, can't get 12,13,14 channel working, even not scanning on client mode. Country regulatory regdomain blocked to USA channel 1-11.
Posted: Fri Mar 28, 2014 20:16 Post subject: Re: What if I dont have GNU wget
arssant wrote:
dllud wrote:
arssant wrote:
But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"
shaan7 wrote:
the busybox wget doesnt support the cookie options
Thus you have to install the full wget using ipkg (DD-WRT) or opkg (OpenWrt).
Hi.
Success, with fon ZON ( Portugal )
I used a fon2201. Ironical, it was originally provided from FON for ZON ISP customers.
But worked with openwrt backfire 10.03.1.
With dd-wrt got issue, as Buss error when running wget. I tried all packages from openwrt ( kamikase, backfire, even adjustment )
One thing I need to fix, only got firsts 11 channels available, can't get 12,13,14 channel working, even not scanning on client mode. Country regulatory regdomain blocked to USA channel 1-11.
Tanks all of you for this script.
Hi! Can you please give me some help concerning my previous posts?