I’m looking for a Script that would check a user’s sum of its uploaded and downloaded usage (total usage) and if it’s more than 10Gb it should lower its download speed by half or set it to a given speed .
I have a scrip that resets all counters and speed to its original status on the first second of a new month.
make some debug output to see what values exactly you are dealing with. also, erase white-spaces around new rate settings.
Best thing to do, is to test separately, values you compare, what is the result with what arguments and then test commands you are trying to run in one or another condition.