Community discussions

MikroTik App
 
obadaabdullah
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 71
Joined: Wed Jan 08, 2014 7:41 pm

removing active users with one profile

Wed Jun 11, 2014 2:22 pm

hi all
i need a script that remove my hotspot users from active users if their profile is "profile1"

thanks
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2954
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: removing active users with one profile

Wed Jun 11, 2014 2:26 pm

Are 50$ at character on keyboard.
I'm Italian, not English. Sorry for my imperfect grammar.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2954
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: removing active users with one profile

Wed Jun 11, 2014 2:36 pm

there are two way:

first, the longer:
:foreach i in=[/ip hotspot active find] do={
 :if ([/ip hotspot user $i get profile]="profile1") do={
  /ip hotspot active remove $i;
 }
}
translation: select all active session and search one-by-one if are one user with profile1, and on that case, remove active session from that users

and the second, the shorter:
:foreach i in=[/ip hotspot user find where profile="profile1"] do={
 /ip hotspot active remove [find where name=$i];
}
translation: select all user with profile1 and remove all active session from that users


and obviously I prefer the second... ;)
I'm Italian, not English. Sorry for my imperfect grammar.
 
obadaabdullah
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 71
Joined: Wed Jan 08, 2014 7:41 pm

Re: removing active users with one profile

Thu Jun 12, 2014 3:48 pm

there are two way:

first, the longer:
:foreach i in=[/ip hotspot active find] do={
 :if ([/ip hotspot user $i get profile]="profile1") do={
  /ip hotspot active remove $i;
 }
}
translation: select all active session and search one-by-one if are one user with profile1, and on that case, remove active session from that users

and the second, the shorter:
:foreach i in=[/ip hotspot user find where profile="profile1"] do={
 /ip hotspot active remove [find where name=$i];
}
translation: select all user with profile1 and remove all active session from that users


and obviously I prefer the second... ;)
i don't what do you mean in the first replay, but what ever you r great
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2954
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: removing active users with one profile

Thu Jun 12, 2014 6:34 pm

...
i don't what do you mean in the first replay...
It's a joke!!! :lol:
I'm Italian, not English. Sorry for my imperfect grammar.
 
obadaabdullah
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 71
Joined: Wed Jan 08, 2014 7:41 pm

Re: removing active users with one profile

Sat Jun 21, 2014 12:22 am

...
i don't what do you mean in the first replay...
It's a joke!!! :lol:

i'm sorry but they doesn't worked!!!!

Who is online

Users browsing this forum: No registered users and 23 guests