Shaping a subnet (or IP add) after a download limit reached?

Hi everyone

I’m hunting around for an example script that would enable me to automatically shape a subnet (or IP address) after a predetermined number of bytes have been downloaded in a given time period, with the ability to automatically unshape the subnet after a different time variable has been reached.

I’ve found examples on the wiki that are based around the user manager however I would prefer to do this by subnet rather than by username. Let me know if you know of any examples…

Thanks

Richard