#!/bin/sh

case "$MODE" in
    start)
	case "$IFACE" in
	    eth*)
		[ "$IF_POINTOPOINT" != "" ] && exit 0
		set `ethtool -g $IFACE | grep "\(RX\|TX\):" | cut -d: -f2`
		ethtool -G $IFACE rx $1 tx $2
		ethtool -K $IFACE rx on tx on sg off tso off
		ethtool -s $IFACE speed 1000 duplex full autoneg on
	    ;;
	    bond*)
	    	[ -f /etc/network/interfaces ] && {
			eth_ifaces=`cat /etc/network/interfaces | grep 'up ifenslave' | sed -e 's/.*bond. //'`
			for ETHI in $eth_ifaces; do
				set `ethtool -g $ETHI | grep "\(RX\|TX\):" | cut -d: -f2`
				ethtool -G $ETHI rx $1 tx $2
				ethtool -K $ETHI rx on tx on sg off tso off
				ethtool -s $ETHI speed 1000 duplex full autoneg on
			done
		}
	    ;;
	esac
	;;
    stop)
	case "$IFACE" in
	    eth0)
	    ;;
	esac
	;;
esac

exit 0

