Re: [gentoo-user] ifconfig and ppp0 address

2012-12-13 Thread Trevor D. Manning
I'm interested also, thanks good sir

* Kevin Chadwick (ma1l1i...@yahoo.co.uk) wrote:
  I can send you the source code if you want. Likewise to any other
  interested reader 
 
 Send to me please, Thanks
 
-- 
Trevor D. Manning

BOFH Excuse #98:

The vendor put the bug there.



Re: [gentoo-user] ifconfig and ppp0 address

2012-12-13 Thread David W Noon
On Fri, 14 Dec 2012 02:33:56 +1100, Trevor D. Manning wrote about Re:
[gentoo-user] ifconfig and ppp0 address:

 I'm interested also, thanks good sir
 
 * Kevin Chadwick (ma1l1i...@yahoo.co.uk) wrote:
   I can send you the source code if you want. Likewise to any other
   interested reader 
  
  Send to me please, Thanks
  

Hi Trevor,

Attached is a tarball of the source code.  Note that you need to check
the Makefile, particularly to ensure the CHOST variable is appropriate
to your system.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dwn...@ntlworld.com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


get_ip_addr.tgz
Description: application/compressed-tar


signature.asc
Description: PGP signature


[gentoo-user] ifconfig and ppp0 address

2012-12-11 Thread Bill Kenworthy
For years I have been using ifconfig and some simple shell magic to
extract the ip address from the adsl ppp session when it changes.  The
latest update has changed the output format of ifconfig breaking things
so if ifconfig cant be relied on, what's normally used to extract an
interfaces IP address?  I can easily rewrite the shell magic, but its
worth asking if there is some command better suited.

BillK





Re: [gentoo-user] ifconfig and ppp0 address

2012-12-11 Thread Alan McKinnon
On Tue, 11 Dec 2012 19:33:15 +0800
Bill Kenworthy bi...@iinet.net.au wrote:

 For years I have been using ifconfig and some simple shell magic to
 extract the ip address from the adsl ppp session when it changes.  The
 latest update has changed the output format of ifconfig breaking
 things so if ifconfig cant be relied on, what's normally used to
 extract an interfaces IP address?  I can easily rewrite the shell
 magic, but its worth asking if there is some command better suited.
 
 BillK
 
 
 

ip tends to be a little more consistent and a little more
script-friendly than ifconfig:

ip -o addr show

-o prints output on one line, making your subsequent grep, sed and
awking easier

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] ifconfig and ppp0 address

2012-12-11 Thread Helmut Jarausch

On 12/11/2012 12:33:15 PM, Bill Kenworthy wrote:

For years I have been using ifconfig and some simple shell magic to
extract the ip address from the adsl ppp session when it changes.  The
latest update has changed the output format of ifconfig breaking  
things

so if ifconfig cant be relied on, what's normally used to extract an
interfaces IP address?  I can easily rewrite the shell magic, but its
worth asking if there is some command better suited.



If you're a Python fan there is a nice tool to replace 'awk' and  
similar tools:

svn checkout http://pyp.googlecode.com/svn/trunk/ pyp

I've patched this to include a 'balanced' (parenthesis, brackets,..)

With the original version I use

ifconfig wlan0 | /usr/local/bin/pyp  
pp.after('wlan0',2)|p[1]|p.re(r'(?=inet )\d+\.\d+\.\d+\.\d+')


If someone is interested in my patch I'm happy to share it,
Helmut.




Re: [gentoo-user] ifconfig and ppp0 address

2012-12-11 Thread David W Noon
On Tue, 11 Dec 2012 19:33:15 +0800, Bill Kenworthy wrote about
[gentoo-user] ifconfig and ppp0 address:

For years I have been using ifconfig and some simple shell magic to
extract the ip address from the adsl ppp session when it changes.  The
latest update has changed the output format of ifconfig breaking things
so if ifconfig cant be relied on, what's normally used to extract an
interfaces IP address?  I can easily rewrite the shell magic, but its
worth asking if there is some command better suited.

I wrote a command in C++ that interrogates the TCP/IP stack directly to
obtain the IP address of any given interface.  I wrote it some years
ago, so it's only IPv4 at the moment; it will take a day or two to add
IPv6 support.

I can send you the source code if you want. Likewise to any other
interested reader -- or I can post it here as a mail attachment, since
it is quite tiny.
-- 
Regards,

Dave  [RLU #314465]
==
dwn...@ntlworld.com (David W Noon)
==


signature.asc
Description: PGP signature


Re: [gentoo-user] ifconfig and ppp0 address

2012-12-11 Thread Kevin Chadwick
 I can send you the source code if you want. Likewise to any other
 interested reader 

Send to me please, Thanks

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)
___