Adjust quotas from command line

Report issues relating to bandwith monitoring, bandwidth quotas or QoS in this forum.

Moderator: Moderators

Post Reply
pkkrusty
Posts: 49
Joined: Mon Jan 13, 2020 4:41 pm

Adjust quotas from command line

Post by pkkrusty »

Is that something possible? When I adjust a quota from the GUI, the router takes ages (like 120 seconds) to finally refresh the page, and I have had issues with the quotas getting corrupted if I navigate to some other page too soon (I assume because I've interrupted some table re-write)

If it is possible, will I still need to wait that time for tables to get rebuilt (or whatever is going on in the background)?

I have 167 quotas and 209 users.

Lantis
Moderator
Posts: 6924
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Adjust quotas from command line

Post by Lantis »

What do you mean by adjust? What parts of the quota do you want to change? What are you trying to achieve by doing so?

This will help guide the response.
The answer is almost certainly "yes", but special care will need to be taken.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

pkkrusty
Posts: 49
Joined: Mon Jan 13, 2020 4:41 pm

Re: Adjust quotas from command line

Post by pkkrusty »

Adjust: Increase and decrease quotas (i.e. Increase 1GB limit to 2GB). Adding/removing quotas would continue to be done by GUI.

Two reasons: 1. Wondering if things would go faster if I use CLI
2. Eventually try to automate the process using Node-Red and SMS, where someone could text me with their phone number and amount, node-red would parse and then issue the correct command to the router to adjust a specific quota. End result is I don't have to spend 30 minutes of each day adding "credit" to people's internet.

Lantis
Moderator
Posts: 6924
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Adjust quotas from command line

Post by Lantis »

Do you want the users usage to reset as well? Or just increase the allowance?
Without testing it
backup_quotas
Alter the quota in /etc/config/firewall
restore_quotas (with all command parameters)

It may not be much faster. A firewall restart may be required but I expect not.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

pkkrusty
Posts: 49
Joined: Mon Jan 13, 2020 4:41 pm

Re: Adjust quotas from command line

Post by pkkrusty »

Just increase the allowance. I'll give those commands a try and see where I can get. Thanks

Post Reply