Community discussions

MikroTik App
 
me2r
just joined
Topic Author
Posts: 4
Joined: Tue Oct 21, 2008 9:16 pm

please help with simple script on v3.9

Wed Nov 05, 2008 11:12 am

Basically on some condition I would need to enable the simple queue for a specific user, however the following script does't work.

:foreach i in [/ip hotspot active find user!=jren036] do={
/queue simple enable [find target-addresses=((get $i address) . "/32")]
}

It got error info:

interrupted
value of target-address cannot begin or end with '/'

Please help on this simple script, thanks in advance.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: please help with simple script on v3.9

Wed Nov 05, 2008 11:48 am

/queue simple enable [find target-addresses="$[get $i address]/32"];
 
me2r
just joined
Topic Author
Posts: 4
Joined: Tue Oct 21, 2008 9:16 pm

Re: please help with simple script on v3.9

Wed Nov 05, 2008 5:33 pm

Hi dude,

Thanks for your reply however it won't work, it says "the target addresses value must have ip address before '/'..."

But finally I got it working with:
/queue simple enable [find target-addresses=([/ip hotspot active get $i address] . "/32")]
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: please help with simple script on v3.9

Thu Nov 06, 2008 8:42 am

Well, you had to set working dir to /ip hotspot active and then execute script.
Otherwise how can 'get' will know that you want to get values exactly from '/ip hotspot active'?

Who is online

Users browsing this forum: No registered users and 27 guests