Package: mii-diag
Version: 2.09-1
Severity: wishlist
Maybe this this script "mii-mon" (mii-monitor) helps.
cat /etc/init.d/mii-mon
#!/bin/sh
PATH=/sbin:/bin
test -x /sbin/mii-tool || exit 0
#This is required because insmod may litter log file with complaints
# every second if non existing ethers are accessed
INTERFACES=`cat /proc/net/dev | egrep '^ *eth.*:' | /usr/bin/cut -d ':' -f1
|/usr/bin/tr -d ' ' | /usr/bin/tr '\n' ' '`
test -n "$INTERFACES" || exit 0
case "$1" in
start)
echo -n "Starting mii-tool..."
start-stop-daemon --start --quiet --pidfile
/var/run/mii-mon.pid -m --exec /sbin/mii-tool -- -w -l $INTERFACES &
echo "done."
;;
stop)
echo -n "Stopping mii-tool..."
start-stop-daemon --stop --quiet --pidfile /var/run/mii-mon.pid
echo "done."
;;
restart|force-reload)
echo -n "Restarting mii-tool... "
start-stop-daemon --stop --quiet --pidfile /var/run/mii-mon.pid
sleep 2
start-stop-daemon --start --quiet --pidfile
/var/run/mii-mon.pid -m --exec /sbin/mii-tool -- -w -l $INTERFACES &
echo "done."
;;
*)
echo "Usage: /etc/init.d/mii-mon
{start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
used options:
-w, --watch
Watch interface(s) and report changes in link status.
The MII interfaces are polled at one second intervals.
-l, --log
Used with -w, records link status changes in the system
log instead of printing on standard output.
-m|--make-pidfile
Used when starting a program that does not create its own
pid file. This option will make start-stop-daemon create
the file referenced with --pidfile and place the pid
into it just before executing the process.
Note, it will not be removed when stopping
the program.
NOTE: This feature may not work in all cases.
Most notably when the program being executed forks
from its mainprocess. Because of this it is usually only
useful when combined with the --background option.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]