How can we not quite the ‘script’? Linux doesn’t quit a script. Windows doesn’t quite a CMD/BAT file. They both continue to execute the commands. The duplicate entry isn’t an error it should just be an informational warning that the entry already exists so RouterOS should be continue execution of the script.
If you pay attention to what line of the config it stopped on, you can continue the import with “import from-line=”, just increment the line number that it stopped on by 1.
But something like “continue import on error” would be a nice feature. +1
I have yet to see a way to get the error message from an imported script returned to the script doing the import. And simply skipping the one line that failed wouldn’t be a good idea, if you have { } cases in the imported script and it fail inside one, you wouldn’t want it to attempt to start in the middle of it.
Something along the lines of an option that makes the import function simulate the behavior of copy-pasting into the CLI.
Possibly dump the whole CLI output (and input) into a specified text file.
My recommendation is to build a script that clears all the items you don’t need prior to running then adds everything it requires back.
IE: Clear all IP addresses at the start then just add the ones you need.
Something like this can be achieved by using a non-interactive initiation of the script (running as an .auto.rsc)
OR
“system reset, on reset run .. ”
OR
:global cmdfinish
:execute {command that will potentially fail goes here; :set cmdfinish “true”;}
loop around a bit waiting for a “true” value otherwise log that the command failed and continue on..
This is a very simple overview so if there’s more interest I can supply some better explanations and examples.