Does the White Russian 0.9 DynDNS client suck just as much?
Tom Buskey
tom at buskey.name
Fri Jun 15 11:10:19 EDT 2007
On 6/15/07, VirginSnow at vfemail.net <VirginSnow at vfemail.net> wrote:
>
> > Date: Fri, 15 Jun 2007 08:42:28 -0400
> > From: "Tom Buskey" <tom at buskey.name>
>
> > I've been using zonedit and a cronjob script to check if my router's IP
> > changed.
> > It's got some old cruft in it.
>
> Please, please, please, folks! Don't even THINK about doing stuff
> like this. (Newbies, cover your eyes!)
There is a reason for doing this way. I'm open to suggestions. Read on.
> # What's my IP?
> > lynx -dump -accept_all_cookies http://www.whatismyip.com | egrep
> '[0-9]' |
>
> Most DHCP clients will store the current IP in some kind of
> lease/cache file. DHCP lease files are usually pretty easy to parse.
> But, if you really must get your IP address the hard way, you could
> use something with fewer teeth than scraping www.whatismyip.com:
>
> # ifconfig "`route | grep default | awk '{print $8}'`" | \
> grep inet | awk '{print $2}' | cut -d : -f 2
If I do that on my linux box it'll *always* say 192.168.1.35 because it's
behind my FiOS router that I can't login to. I don't have direct access to
the IP that FiOS gives the router via IP. So, I go to a web site that tells
me what IP is on the other side of the NAT. I'd love to have a better
solution that works.
The lease files can be parse, but the ISC DHCP server docs say they will not
stay the same so don't parse them. Of course you can say the same about the
Linux API which changes all the time. If it works, use it & fix it when it
doesn't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20070615/e88dee33/attachment.html
More information about the gnhlug-discuss
mailing list