On 7/27/06, David Looney <[EMAIL PROTECTED]> wrote:
Carl Lowenstein wrote:
> On 7/26/06, David Looney <[EMAIL PROTECTED]> wrote:
>> Lan Barnes wrote:

[r.e. utility to email when cox dhcp ip changes]

>
> OK, how about this one:
>
> $ /usr/sbin/traceroute -n -m1 2>/dev/null $(gawk '/nameserver/{print
> $2; exit}' /etc/resolv.conf) | gawk '{print $2}'

This is very nice, but as you noted:

> Of course this doesn't work if the
> DHCP server in your home router believes that it too is a nameserver.

Mine pretends to be one, putting it's own lan address in
/etc/resolv.conf and /var/lib/dhcpcd/dhcpcd-eth0.info as DNS= the lan
gateway ip.


I'm trying to avoid having to know an external host name.  Of course,
if you don't have any DNS it doesn't do you much good to know your own
IP address.

My current solution works with the Motorola Surfboard 5100 that
RoadRunner uses.  I know the internal IP address of the cable modem.

   #!/bin/bash
   SB=192.168.100.1         # Motorola SurfBoard 5100
   /bin/traceroute -n -m1 $SB 2>/dev/null |
   /bin/gawk '{print $2}'

   carl
--
   carl lowenstein         marine physical lab     u.c. san diego
                                                [EMAIL PROTECTED]


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to