#!/bin/bash
#stupid traffic shaping for transit interfaces
#just split the line between active connections.

FACE=$1

TC=`which tc`

echo "Setting $FACE to equalize speeds using ESFQ"

case "$hash" in
    "src")
	;; 
    "dst")
	;;
    "")
	if [[ $FACE =~ "imq" ]] ; then
	    hash=src
	else
	    hash=dst
	fi
	;;
    *)
	echo "Error: Unknown hash type: $hash" >&2
	exit 1
esac

$TC qdisc add dev $FACE parent 1:4 handle 2: esfq hash $hash perturb 5
