Red Hat Bugzilla – Bug 73115
Have mii-tool call a script on status changes
Last modified: 2015-03-04 20:11:24 EST
mii-tool has the capability to watch a network interface for status changes. It
is a simple enhancement to make it do something useful when it detects a status
change. I will attach a short patch which adds a --script option; mii-tools
will call this script with the name of the changing interface and the string
"up" or "down" as arguments.
One such useful script is:
This allows a laptop user to bring the network up just by plugging the cable in.
Perhaps there is another way to do this, but I couldn't find it and this hack
was easy enough.
Beware, though, that my C is rusty, I haven't included a manpage patch, and this
is just a hack. If this would be useful to others or might be included, I will
happily clean it up.
Created attachment 74024 [details]
Patch to mii-tool
Will check to include sometime later.
Read ya, Pil