I need a script that will remove all hotspot users at 00:00 every night. My hotspot is running on Ros6.15
What do you intend for “remove”?
Disconnect or delete all users made?
if is the last case, supposing you use user-manager, schedule this at each midnight:
/tool user-manager user remove [find];
/tool user-managersession remove [find];
/tool user-manager database clear-log;
/tool user-manager database rebuild;
/system reboot;
If you paste this on console ask yes or not, but if you put on script, do not ask anything and go.
Thank you for your suggestion. I am not using usermanager. I need to delete all entries under the user list in Hotspot. The reason for this is that hotspot users get 400mb free and thereafter they need to purchase access through the portal on the landing page. I have a script in place to remove all users that have reached their quota and this is scheduled to run at midnight. This is the one I have tried to clear all users but it does not work :foreach counter in=[/ip hotspot user find ] do={/ip hotspot user remove}
If you see what I have writed, you can deduce to do this:
/ip hotspot user remove [find];
Thanx rextended! Working well
Hi Sapieh;
We want to delete session time out users (when session timeout)at mikrotik hotspot users.Is there any way to do this?
thanks…
Paste this into a terminal on your Router board and schedule it to run at midnight
add name=“Clear users” policy=
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api
source=“/ip hotspot user remove [find];”
l need a script for removing users from user manager but only users whose have finished their uptime please!!!
can someone knows the script please help us i need it too thanks