AutoLogin Script

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions
Goto page 1, 2, 3  Next
Author Message
dllud
DD-WRT Novice


Joined: 09 Feb 2014
Posts: 4

PostPosted: Sun Feb 09, 2014 2:23    Post subject: Scripts for FON in Portugal (ZON) Reply with quote
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):
Code:
etc/hotplug.d/iface/99-login-fon

Code:
#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
   wget -qO- --output-document=/dev/null --no-check-certificate --save-cookies=cookie --keep-session-cookies http://search.yacy.net
   wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="login_email=<your_email>&login_password=<your_pswd>&login_reminder=checked" https://www.fon.com/login/gateway/processLoginCustom
   rm cookie
fi
Sponsor
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 153

PostPosted: Tue Mar 18, 2014 0:49    Post subject: Re: Scripts for FON in Portugal (ZON) Reply with quote
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
dllud
DD-WRT Novice


Joined: 09 Feb 2014
Posts: 4

PostPosted: Tue Mar 18, 2014 9:19    Post subject: Re: What if I dont have GNU wget Reply with quote
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 Crying or Very sad


Thus you have to install the full wget using ipkg (DD-WRT) or opkg (OpenWrt).


Last edited by dllud on Fri Mar 21, 2014 8:44; edited 1 time in total
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Tue Mar 18, 2014 23:15    Post subject: Reply with quote
dllud, I'm using a TP-LINK WR841ND router to receive/transmit the Fon Zon signal, and everything is working ok.

Now, of course I'm interested to do the automatic login on FON... but I have some doubts:

Did you use this wget - http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/wget_1.13.4-1_ar71xx.ipk ?
The script is to to be copied in "Administration - Commands" using the webinterface?

I don't want to brick my router.. lol

Thanks in advance and best regards,
P.A (e também sou tuga :p)
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Sun Mar 23, 2014 14:20    Post subject: Reply with quote
UP!!!

Anyone help me?

Best regards,
P.A
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Tue Mar 25, 2014 20:15    Post subject: Reply with quote
Sorry to insist... but no one can give me some help?

regards,
P.A
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 153

PostPosted: Wed Mar 26, 2014 15:29    Post subject: Re: What if I dont have GNU wget Reply with quote
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 Crying or Very sad


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.
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Fri Mar 28, 2014 20:16    Post subject: Re: What if I dont have GNU wget Reply with quote
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 Crying or Very sad


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?

Thanks. regards,
P.A
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 153

PostPosted: Fri Mar 28, 2014 22:43    Post subject: Re: What if I dont have GNU wget Reply with quote
gandamaluko wrote:

Hi! Can you please give me some help concerning my previous posts?

Thanks. regards,
P.A


Hi,

look at dllud post.

Code:
   
/etc/hotplug.d/iface/99-login-zon


This is the right place for the script.
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Wed Apr 02, 2014 23:00    Post subject: Reply with quote
Hi,

I can't find the folder hotplug as you can see in this image:



I need to create that folders, or I can put this code in another place?
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 153

PostPosted: Fri Apr 04, 2014 14:02    Post subject: Reply with quote
gandamaluko wrote:
Hi,

I can't find the folder hotplug ....

I need to create that folders, or I can put this code in another place?


Hi.

See at my post and dllud too:

arssant wrote:
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 )


dllud wrote:
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.


So only tested and confirmed by myself with openwrt, not dd-wrt.
I tryed with dd-wrt with no success.
iMartins87
DD-WRT Novice


Joined: 29 Apr 2014
Posts: 2

PostPosted: Wed Apr 30, 2014 9:46    Post subject: Reply with quote
Hi,

If i understand, you are used a fonera+(Fon2201) with OpenWRT backfire 10.03.1, package "wget-nossl" installed and cliente mode configured to connect a fon_zon_free_internet (interface wireless name "wwan"), me too.

For auto login I edit the Zon script, that the dllud insert in topic, with my user and password (for example ..post-data="USERNAME=XYZ@gmail.com&PASSWORD=passXYZ&remember=on" $POST_URL..), saved with name "99-login-zon" and copy for etc/hotplug.d/iface/

However the auto login dont work!

I need install the package "wget" or other? I only install "wget-nossl".
May be related to the network signal strength I get?

PS: Tb sou tuga :-p
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 153

PostPosted: Wed Apr 30, 2014 11:43    Post subject: Reply with quote
iMartins87 wrote:
Hi,

If i understand, you are used a fonera+(Fon2201) with OpenWRT backfire 10.03.1, package "wget-nossl"
I need install the package "wget" or other? I only install "wget-nossl".
May be related to the network signal strength I get?

PS: Tb sou tuga :-p


Hi.

Right. Do NOT use wget-nossl ( remove it ) or better, do factory default and reinstall all 3 ipk ( wget zlib libopenssl ) from scratch, but with correct wget ( wget_1.13.4-1_atheros.ipk , this is for atheros based processor ( aka fonera ))
About signal, from 15-20% quality, it start working nicely.
iMartins87
DD-WRT Novice


Joined: 29 Apr 2014
Posts: 2

PostPosted: Sat May 03, 2014 9:41    Post subject: Reply with quote
Thanks arssaant,

It's works fine with package wget_1.13.4-1_atheros.ipk (wget, zlib and libopenssl).

Best regards
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 153

PostPosted: Mon May 05, 2014 23:55    Post subject: Reply with quote
iMartins87 wrote:
Thanks arssaant,

It's works fine with package wget_1.13.4-1_atheros.ipk (wget, zlib and libopenssl).

Best regards


Hi.

simple script to check internet connection:

/etc/hotplug.d/iface/99-net-link

amber of wireless led become on when no internet.
amber of power led become on when connected to fon_zon targed router and internet is up.


Code:

/usr/bin/gpioctl dirout 1 >/dev/null 2>/dev/null
/usr/bin/gpioctl dirout 7 >/dev/null 2>/dev/null

if ping 208.67.222.222 -c 1 > /dev/null
  then
  /usr/bin/gpioctl set 7 >/dev/null 2>/dev/null
  /usr/bin/gpioctl clear 1 >/dev/null 2>/dev/null
  else
  /usr/bin/gpioctl clear 7 >/dev/null 2>/dev/null
  /usr/bin/gpioctl set 1 >/dev/null 2>/dev/null
fi


and on luCI menu, system, at local startup

A small correction for power and system led.

Code:

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

/usr/bin/gpioctl dirout 4 >/dev/null 2>/dev/null
/usr/bin/gpioctl clear 7 >/dev/null 2>/dev/null
/usr/bin/gpioctl set 4 >/dev/null 2>/dev/null

exit 0
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum