From: Stefan Metzmacher Date: Mon, 18 Jan 2010 12:05:54 +0000 (+0100) Subject: config: 10.interface: search "ethtool" in $PATH instead of using a hardcoded path X-Git-Tag: ctdb-1.0.114~62 X-Git-Url: http://git.samba.org/?p=ctdb.git;a=commitdiff_plain;h=3bab985cf615720eded4d47b4f9f37a9c28840aa config: 10.interface: search "ethtool" in $PATH instead of using a hardcoded path 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 --- diff --git a/config/events.d/10.interface b/config/events.d/10.interface index 4f7e8de8..9365106f 100755 --- a/config/events.d/10.interface +++ b/config/events.d/10.interface @@ -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" && {