Hi everyone
First of all, I am no expert, or even novice, in these things so please be patient with me.
I have an RB951G-2HnD routerboard that I bought solely to limit data and time for home users. I have set profiles in hotspot for every user with daily or weekly limits and scheduled this script to reset counters every morning depending on the user’s package
/ip hotspot user reset-counters [find name="username"]
and it works fine if each user reached their limits or if they still have limits and logged off the hotspot status page before the script running time, but if a user is still logged in in the status page and is still using what limits are left for them from the previous day, let’s say they have a 1G daily limit and they still have 100m the next day, they have to log off then log in after running the script, If they don’t and they finished the 100m after the script was ran then they’re logged off and when they try to log in again they’re told that they’ve reached their limits. The same happens even if I run the script manually in the terminal or went to the hotspot users and reset counters for the user from their profile, they have to log off and log in if they still have limits from the previous day.
I want to know, is there a way to fix this?
Thank you and I truly appreciate any help.
Thank you for your response, but I have to clarify that this is not the problem. When the client reaches their quota they’re disconnected, the problem is that if they don’t reach their limit and they still have time or data at the next interval and they continue using what is left of their quota from the previous day they get disconnected after they reach the previous day’s quota and then when they try to log in again they’re told that they’ve reached their limit and they can’t use the next day’s quota. So they have to log off and in again after the script is run if they don’t reach the previous day’s limits to use the next day, the day they’re in, full limits. I hope I was able to deliver my problem clearly since English is not my first language.
Another thing to clarify, I don’t know anything about scripting, all of the scripts I am using are from this forum and other websites.
I think I found a way around it, I scheduled a script to remove the user if he’s still active and then another script to reset their counters. First I have to explain that all of this have to be done according to the status autorefresh. For example, if the user profile Autorefresh is set to refresh every minute then scheduling the two scripts below have to be under one minute apart:
So if this script is scheduled to run at 07:00:00
/ip hotspot active remove [find user="username']
then we can reset counters at 07:00:15 or 07:00:30
/ip hotspot user rest-counters [find name="username"]
Still, if someone can help with a better solution it’ll be appreciated.