How to update reseller’s subaccounts disk quota and bandwidth on cPanel server

Useful if you have plan limited by:

– limitation by amount of cPanel accounts
– bandwidth limitation
– disk space limitation
– overselling disabled

Update reseller’s packages with new limits via command line

sed -i -e "s/QUOTA=.*/QUOTA=2000/g" /var/cpanel/packages/resellerusername_*
sed -i -e "s/BWLIMIT=.*/BWLIMIT=20000/g" /var/cpanel/packages/resellerusername_*

Update for a single user their quota and bandwidth

whmapi1 --output=jsonpretty editquota user=username quota=2000
whmapi1 --output=jsonpretty limitbw user=username bwlimit=200000

Mass action

for i in `grep resellerusername /etc/trueuserowners |cut -d: -f1`; do whmapi1 --output=jsonpretty editquota user=$i quota=2000; done
for i in `grep resellerusername /etc/trueuserowners |cut -d: -f1`; do whmapi1 --output=jsonpretty limitbw user=$i bwlimit=20000; done

Source:

https://api.docs.cpanel.net/openapi/whm/operation/limitbw/

https://api.docs.cpanel.net/openapi/whm/operation/editquota/

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *