Community discussions

MikroTik App
 
technoken
just joined
Topic Author
Posts: 1
Joined: Wed Jun 27, 2018 12:35 pm

script that remove active hotspot user if the name is not in the Users anymore

Sun Jul 08, 2018 6:12 pm

Hi guys! I'm just a newbie at scripting. I was wondering how can I remove active hotspot user if they are already removed from the Users tab.

I have this script that automatically removes a user from Users tab
for x from=0 to=6 do={
    /ip hotspot user set [find comment=$x] comment=($x-1)
    delay 50ms
}
/ip hotspot user remove [find comment=-1]
I tried to do it this way
for x from=0 to=6 do={
    /ip hotspot user set [find comment=$x] comment=($x-1)
   /ip hotspot active set [find comment=$x] comment=($x-1)
    delay 50ms
}
/ip hotspot user remove [find comment=-1]
/ip hotspot active remove [find comment=-1]
Then I found out that comments in Active tab cannot be modified that way.
So when the user is an active one, they are not removed from the Active tab.

Any help? :D

Thanks in advance!

Who is online

Users browsing this forum: sch and 78 guests