config: 10.interface: search "ethtool" in $PATH instead of using a hardcoded path
authorStefan Metzmacher <metze@samba.org>
Mon, 18 Jan 2010 12:05:54 +0000 (13:05 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Jan 2010 10:11:04 +0000 (11:11 +0100)
This is very useful for testing, I use such a script:

cat ~/bin/ethtool
 #!/bin/sh

 IFACE=$1

 case "$IFACE" in
        Neth2)
                ;;
        Neth3)
                ;;
        Neth4)
                ;;
        Neth5)
                ;;
        *)
                exec /usr/sbin/ethtool $@
                ;;
 esac

 ip link set down $IFACE

 exec /usr/sbin/ethtool $@

metze

config/events.d/10.interface

index 4f7e8de84e431b839e72fdabf586bedd0936fc6d..9365106f176861ee70ebab891c69139765b1d2b5 100755 (executable)
@@ -81,13 +81,13 @@ monitor_interfaces()
                ;;
            *)
                [ -z "$IFACE" ] || {
-                   /usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
+                   ethtool $IFACE | grep -q 'Link detected: yes' || {
                        # On some systems, this is not successful when a
                        # cable is plugged but the interface has not been
                        # brought up previously. Bring the interface up and
                        # try again...
                        /sbin/ip link set $IFACE up
-                       /usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
+                       ethtool $IFACE | grep -q 'Link detected: yes' || {
                            echo "ERROR: No link on the public network interface $IFACE"
                            fail=1
                            test -n "$OLDLINK" && {