On some systems, the ethtool link detection is not successful when a
cable is plugged but the interface has not been brought up previously.
This improves the test by bringing the interface up (without checking
for success here) and trying the ethtool test again afterwards.
Michael
*)
[ -z "$IFACE" ] || {
/usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
- echo "ERROR: No link on the public network interface $IFACE"
- exit 1
+ # 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' || {
+ echo "ERROR: No link on the public network interface $IFACE"
+ exit 1
+ }
}
}
;;