[svlug] how to detect ethernet cable is plugged in

Chris Wesley cwwesley at udlug.org
Thu May 1 10:08:09 PDT 2003


On 30 Apr 2003, HvR wrote:

> my window boxes (yes i  have to have a few for my work) detect when the
> ethernet cable is plugged in or out, how would one detect this under
> linux? any clues?

mii-diag --status eth0

When you don't have a link, you'll find "Link status: not established" in
the output, and "You have link beat, and everything is working OK" if you
do.  (Of course, use whatever iface name you're monitoring, and check out
the rest of mii-diag's options.)

	g.luck,
        ~Chris





More information about the svlug mailing list