Hi Guys,
I have a script that loads and address list into an array for further processing on the array rather than trying to muck with the address list directly.
This is the code:
# for each IP in the unchecked list load it into an array
:set i (0);
:foreach fwlist in=[/ip firewall address-list find where list=Address_list] do={
:foreach ip in=[/ip firewall address-list get $fwlist value-name=address] do={
:set ($array->"$i") $ip;
:put "$ip is loaded into array at index $i"
#remove ip from address list once loaded
/ip firewall address-list { remove [find address=$ip list=Address_list]};
:set i ($i + 1);
};
};
But it takes an age to load the addresses into the array. I’m not the greatest coder but there has to be an easier & faster way to load an Address list into an Array?
Any guidance would be appreciated ![]()