Script for Daily Uptime Limit for Hotspot users

Could someone help me out on script that will restrict the number of hours a user should be up and browsing per day. ie, if a user is to be allowed access for say, one month, i need to be able to restrict his/her uptime to say, 5hrs per day for the one month. Once this uptime limit is reached, the hotspot should log the user out, and allow the user access again only on the next day.
Am still novice to Script and new to Mikrotik

The configuration for HotSpot only.

  • to set limit for 5 hours of Internet usage,
ip hotspot user add limit-uptime=5h name=<username>
  • to allow 5 hours a day, you need to reset counters once a day or over the required period,
ip hotspot user reset-counters [find]

add this line to /system sceduler and set required interval, for example 1 day at 00:01 to reset the counters and allow new 5 hours for the same user.

hallo sergejs,

is it right that this is not running with user manager…
i tried to reset counters, but it only resets “used time”, not “left time”.
so if “left=0” you don´t get new time if you reset the user …

regards

gerd

I Have the same problem i need to refresh the users every single night at 12AM
So they can use the internet next day morning ,
Any Scrips ?
Please

hi

you may find this useful…I had the same problem so I did this

hope it helps

http://forum.mikrotik.com/t/hotspot-limit/41167/1

thanks, that really helped

Very helpful, But can we reset some set of users in a profile instead of all users? if yes how can this be achieved from the script?

See the other thread in which you asked the same question.

Asking the same question all over the place wastes other people’s time.

When nobody is responding or helping!

The two posts are three minutes apart.

I was just anxious of a solution as I am under pressure from my clients!

hi everyone,

we’ve using MikroTik user man, within the validity period it shows an error message “uptime limit reached”. for example, i generated 30 days validity cards. these cards are expired within a week and it shows an error “uptime limit reached”.
help me to rectify this error…

How about to Reset Counter everyday using script thanks

{
 /ip hotspot user reset-counters
}

I hope it will be of great help @joshuanieves32.




EL DONCITO.