On 10/10/06, Dan Nicholson <[EMAIL PROTECTED]> wrote:

$ cat /sys/class/net/<device>/carrier

It returns 1 if the cable is connected and 0 if it's not. This
corresponds with the output from ip's NO-CARRIER. You can read more
here:

http://lkml.org/lkml/2004/9/26/83

Hey, could somebody else try out this command? I just want to make
sure others are seeing the same thing before I stupidly commit it.

[network cable connected]
$ cat /sys/class/net/eth0/carrier
1
[network cable disconnected]
$ cat /sys/class/net/eth0/carrier
0

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to