About monthly quota script

Hello All,

I want to assign a monthly quota for the users in ppp secrets based on their profile .

Ex :
Users of 1 M has a monthly quota 40 GB .
Users of 2 M has a monthly quota 60 GB .
… etc

After the quota finished their speeds is downgraded to 128K .


How can i do that ?!?