#!/bin/sh

# Your upload rate, minus a few percent
ULRATE=400kbit

# size of the buffer, raise this for faster modems, default 1540
BURST=2500

# device
DEV=eth1

case "$1" in
	start)
		tc qdisc add dev $DEV root tbf rate $ULRATE latency 50ms burst $BURST
		;;
	stop)
		tc qdisc del dev $DEV root
		;;
	status)
		tc qdisc
		;;
    restart)
        $0 stop && $0 start || return=$rc_failed
        ;;
    *)
        echo "Usage: $0 {start|stop|status|restart}"
        exit 1
esac
