/ip firewall address-list export file=AddList.rsc
How do I use the above in a script to export only the two desired list “DHCP” and “CutOff”?
Help appreciated new to scripting. very powerful tool..
Greg
/ip firewall address-list export file=AddList.rsc
How do I use the above in a script to export only the two desired list “DHCP” and “CutOff”?
Help appreciated new to scripting. very powerful tool..
Greg
You can’t export it directly… but you could run a script that extracts those lists and prints them to the console. Then you could copy/paste the text and save it to a text document.
{
/ip firewall address-list
:local myList {"DHCP";"CutOff"}
:local output "/ip firewall address-list\r\n"
:foreach i in=[find] do={
:local name [get $i list]
:foreach j in=$myList do={
:if ($name = "$j") do={
:set output ($output . "add address=$[get $i address] list=$name\r\n")
}
}
}
:put $output
}
Any news on this?
I too would like to be able to export only a particular address-list for automation.(without copy paste)
I managed to convert all dynamic records to static on a schedule so this is not a problem.
Still no luck?
Found the solution! http://forum.mikrotik.com/t/a-script-to-save-an-ip-list/14009/1
/ip firewall address-list print file=SomeFileName where list=“SomeAddressListName”