#!/bin/sh

# This will cap your hotline server and hotline client uploads at 5k/sec.
# MAXSPEED is in bytes.

# Setup a few variables
MAXSPEED=5120
RULENUM=00075
IP=any
INTERFACE=en0

# Launch throttled with cap of 5k/sec.
/usr/local/sbin/throttled -s $MAXSPEED -d 5555 -r $RULENUM || exit

# bind for hotline server
/sbin/ipfw add $RULENUM divert 5555 tcp from $IP 5501 to any out xmit $INTERFACE

# bind for hotline client uploads
/sbin/ipfw add $RULENUM divert 5555 tcp from $IP to any 5501 out xmit $INTERFACE
