Page 1 of 1

Problem with "name rewrites script"

Posted: Wed Feb 04, 2009 3:22 am
by B_U_L_I
Hi
I hawe a problem with the script:
 :foreach ip in=[/ip firewall address-list find list=("USERS_ON_LAN")] do={/i
p firewall address-list  set [find list=("USERS_ON_LAN") address=[/ip firewall address-list g
et $ip address]] comment=[/queue simple get [find target-addresses=[/ip firewall address-list
 get $ip address]] name ]} 
The script is to move the names of the queues in the addresslist comment. I used it in version 2.9 and work there without a problem I have now 3.20 and I can not run it. Where do I make an error.

Re: Problem with "name rewrites script"

Posted: Thu Mar 05, 2009 5:40 pm
by nest
I think the problem is that you have to set the variables you intend to use at the top of your script before using them?
# Set local variables
:local ip

Re: Problem with "name rewrites script"

Posted: Mon Mar 09, 2009 12:08 pm
by janisk
yes that should be the case, you have to initiate it first, even if you intend to use global variable and then you can access its value.