Hello,
I have some scripts on my router to collect bad IP addresses from multiple files
Unfortunately the scripts stop upon error.
The error in all cases is that IP already exists . The IP could have been imported from an earlier file.
The error displayed in the log :
"script error failure already have such entry"
There is no way that I can check every file for duplicated IP, my database has over 7000 black-listed IP.
I seek a solution to ignore the error and continue the script execution.
Thank you for your help.
My router OS version is 6.42.6
this is one of my scripts: They all look the same but the file name is different
:foreach i in=[/ip firewall address-list find ] do={
:if ( [/ip firewall address-list get $i comment] = "IPblacklist1" ) do={
/ip firewall address-list remove $i
}
}
/import file-name=IPblacklist1.rsc;
:log info "Removal old IPblacklist1 and add new";
thank you in advance for your help