add a test to see whether ethtool is available before trying to run it
This commit is contained in:
1 parent
9924f420e5
commit
dced4e3d6f
1 file changed
+6
-1
+6
-1
@@ -87,7 +87,12 @@ ip netns exec $NSPID ip link set $GUEST_IFNAME name $CONTAINER_IFNAME
|
||||
ip netns exec $NSPID ip addr add $IPADDR dev $CONTAINER_IFNAME
|
||||
ip netns exec $NSPID ip link set $CONTAINER_IFNAME up
|
||||
|
||||
ip netns exec $NSPID ethtool -K $IFACE tx off > /dev/null
|
||||
if [ command -v ethtool >/dev/null 2>&1 ]
|
||||
then
|
||||
ip netns exec $NSPID ethtool -K $IFACE tx off > /dev/null
|
||||
else
|
||||
echo "Unable to run ethtool command; continuing without it" >&2
|
||||
fi
|
||||
|
||||
[ -f /var/run/netns/$NSPID ] && rm -f /var/run/netns/$NSPID
|
||||
|
||||
|
||||
Reference in new issue
Block a user