in reply to Limiting bandwidth
http://www.onlamp.com/pub/a/bsd/2001/07/26/Big_Scary_Daemons.html
I don't know of any good way to limit bandwidth consumption from your script.