#!/bin/bash -x
#stupid traffic shaping that just limits the 
#total speed of the interface
#FACE, iface, speed, rate
FACE=$1
SPEED=$3
RATE=$4

[ -r /etc/qos/qos-$FACE ] && . /etc/qos/qos-$FACE

if [ -n "$burst" ] ; then
    burst_text="burst ${burst}kbit"
fi

echo "Setting up $FACE to speed $SPEED, burst $burst_text"

TC=`which tc`
$TC qdisc add dev $FACE parent 1:4 handle 2: htb default 10
$TC class add dev $FACE parent 2: classid 2:10 htb rate ${SPEED}kbit $burst_text prio 1

