Here's one way, I'm sure there are 100 more:

/sbin/ifconfig ppp0 | grep 'inet addr' | awk -F':' '{print $2}' | awk
'{print $1}'

Stew Benedict



At 08:22 AM 12/05/2000 -0800, you wrote:
>i am trying to write a little shell script that will
>update my dns on a remote machine every 10 minutes,
>using nsupdate. the problem is I need to get the IP
>address of my dsl connection, but i can't seem to find
>a way to parse the output from ifconfig. my connection
>uses PPPOE. i would be very appreciative if one of the
>perl gurus would point me in the right direction. 
>
>
>here is the output from ifconfig, the only thing i
>need is the inet addr.
>
>ppp0      Link encap:Point-to-Point Protocol
>          inet addr:138.89.32.190  P-t-P:10.5.1.1 
>Mask:255.255.255.255
>          UP POINTOPOINT RUNNING NOARP MULTICAST 
>MTU:1492  Metric:1
>          RX packets:57247 errors:0 dropped:0
>overruns:0 frame:0
>          TX packets:40905 errors:0 dropped:0
>overruns:0 carrier:0
>          collisions:0 txqueuelen:10
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Shopping - Thousands of Stores. Millions of Products.
>http://shopping.yahoo.com/
>
>
>
>_______________________________________________
>Redhat-list mailing list
>[EMAIL PROTECTED]
>https://listman.redhat.com/mailman/listinfo/redhat-list
>
>



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to