Re: Is there a utility to get IP address from interface?
On Wed, Jun 09, 2004 at 11:08:12AM +1000, James Sinnamon wrote:
> Dear debian users,
>
> Is there a utility to simply return the IP address of an interface, say
> eth1 or ppp0? I need something that works like:
>
> $ netutil eth0
> 144.133.251.117
>
> ... or is it necessary to use ifconfig something like as follows:
>
> $ ifconfig eth0 | sed ' ... ' | cut '....' | awk '...' | .... etc
> 144.133.251.117
>
> ?
>
> TIA
>
> James
>
> PS. I am doing this all in order to get ddns3 working so any pointers to
> useful docs would be greatly appreciated.
I would just put a script in /etc/ppp/ip-up.d/. Scripts there are run
once a ppp link is up, and get environment variables containing the ip
address among other things. Have a look at /etc/ppp/ip-up for more
information.
Frank
> --
> James Sinnamon
> jps at westnet com auStralia
> ph +61 412 319669, +61 2 95692123, +61 2 95726357
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
Reply to: