[NBLUG/talk] Ethernet connection status

Barry Stump barry at shrewdlogic.com
Tue Jun 27 14:29:53 PDT 2006


Does anyone know of an easy way to determine the status of an ethernet 
connection from a shell script?  I'm hoping there's some parameter for 
ifconfig or possibly something in the /proc filesystem that will do it. 
I'd like to be able to determine whether or not eth0 is up and connected. 
A disconnected cable at boot time is easy to detect because eth0 won't 
initialize and therefore won't show up in the output from ifconfig. 
However, disconnecting the cable once the box is running doesn't change 
the output, and I don't want to resort to ping.

-Barry

+--------------------------------------------------------------------+
| There are two theories to arguing            Barry Stump           |
| with women. Neither one works.               barry at stump.net       |
|                                              barry at shrewdlogic.com |
+--------------------------------------------------------------------+




More information about the talk mailing list