View Single Post

  #3 (permalink)  
Old 02-05-2006
Gary Dale
 
Posts: n/a
Default Re: using curl to log in to router

alex wrote:
> Gary Dale wrote:
>
>> I'm trying to use curl to log in to a router so I can retrieve the
>> current WAN IP address periodically - it changes at least twice a week
>> and getting it manually is annoying (obviously I need to do this from
>> the LAN side). I can get the appropriate line through curl and grep once

>
>
> Maybe I'm just lazy, but rather than curl i just use the following line:
>
>
> wget http://checkip.dyndns.org -qO - | cut -d : -f 2 | cut -d '<' -f 1
>
>
> should work just fine for you.. as long as you have wget & cut.. ;)
>
>


Yes. In fact curl and grep can do the same thing (probably a bit simpler
too) - as long as the service exists and is free. On the other hand,
querying the router will always be there and be free. I just need to
ensure that the script containing the password is properly secured.

I've got this working on another router from a different manufacturer,
but not this particular one. The other router uses a normal
user-id:password syntax to log in. Then it's just a matter of
identifying the correct page to extract the ip address from.
Reply With Quote