Hi,
Does anyone know if there is a command in the Mikrotik to find users in the local PPP user database with a certain phrase in the name field? For example, I would like to run a ‘foreach’ loop that affects all users with @isp1.com at the end of their name. I’m running Mikrotik 2.8 and I can’t see anything about it in the manual.
Thanks in advance,
Darragh.
Eugene
July 15, 2005, 12:03pm
2
[admin@rb11] ppp secret> print
Flags: X - disabled
# NAME SERVICE CALLER-ID PASSWORD PROFILE REMOTE-ADDRESS
0 ex any default 0.0.0.0
1 ex@a.a any default 0.0.0.0
2 ex@a.b any default 0.0.0.0
3 egx@a.a any default 0.0.0.0
[admin@rb11] ppp secret> :foreach i in [find] do={:if ([:find [get $i name] "@a.a"]!="") do={:put [get $i name]}}
ex@a.a
egx@a.a
[admin@rb11] ppp secret>
Thanks for the reply. The command doesn’t seem to work though. I get the following output :
ERROR: no such command or directory (find)
I’m in the ppp secret section of the Mikrotik and I copied the exact phrase you gave (I just changed the @a.a bit).
Any ideas? I’m running Mikrotik 2.8.18.
sten
July 18, 2005, 6:08am
5
I thought this code only works on v2.9
Eugene:
Yup, v2.9 only
I see. I thought it would work with 2.8 because I mentioned that I used v2.8 in my original post. Thanks anyways.
Eugene
July 21, 2005, 9:29am
8
You can add a comment for each user with a value equal to its domain name and then search by comment. Should work for 2.8 too.