Hi guys,
I"m writing this script to resolve my NIC card hanging upon shutdown.
The script is executed , but it has no effect (even after reboot).
I put this script in /sbin and add its entry in rc.local, if that matter.
The purpose is to have my NIC to disable TSO, and GSO after it's up.
Bash
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin
# This script is turning off GSO, & TSO offloading on NICs.
case "$1" in
eth0)
echo "Turning off offloading on eth0..."
if [[ "$1" = "eth0" ]] && [["$2" = "up" ]]; then
/sbin/ethtool -K eth0 tso off
/sbin/ethtool -K eth0 gso off
echo "Successfully turned off eth0 offloading."
echo $?
fi
;;
eth1)
echo "Turning off offloading on eth1..."
if [[ "$1" = "eth1" ]] && [[ "$2" = "up" ]]; then
/sbin/ethtool -K eth1 tso off
/sbin/ethtool -K eth1 gso off
echo "Successfully turned off eth1 offloading."
echo $?
fi
;;
bond0)
echo "Turning off offloading on bond0..."
if [[ "$1" = "bond0" ]] && [[ "$2" = "up" ]]; then
/sbin/ethtool -K bond0 tso off
/sbin/ethtool -K bond0 gso off
echo "Successfully turned off bond0 offloading."
echo $?
fi
;;
*) exit $NA
;;
esac
exit 0
Display More