Re: [expert] Re: Detecting an Active Network Interface

2002-08-15 Thread jipe

On Thu, 15 Aug 2002 13:50:52 -0700
Mad Scientist [EMAIL PROTECTED] wrote:

  On Thu, 15 Aug 2002, Randy Kramer wrote:
  1.  Anybody know a good way to detect that a network link is active?  
 
 The following will output a 1 to standard out if interface is up. I tested 
 with eth0 but I assume it will work with ppp0 as well. 
 
 ifconfig | grep interface -A 2 | grep -c UP 
 
  -Mad 
 
  --
 Madness is soil in which creativity grows 
 
   - Chris Bielek 
 
 

-A 3 works in more cases. for ex, if u have a line beginning with adr inet6.

eth0  Lien encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
  inet adr:x.x.x.x  Bcast:x.x.x.x  Masque:x.x.x.x
  adr inet6: ::xxx:::/xx Scope:Lien
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

bye
jipe



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [expert] Re: Detecting an Active Network Interface

2002-08-15 Thread Randy Kramer

Mad Scientist wrote:
 The following will output a 1 to standard out if interface is up. I tested
 with eth0 but I assume it will work with ppp0 as well.
 
 ifconfig | grep interface -A 2 | grep -c UP

Ahh, cool!  And I can adopt that to check the results of a ping (which
is what I really need to check), even though I said network interface.
;-)

Thanks!

Randy Kramer



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com