dns-update stop exection script

Hi everyone,

Scenario: RB493 v. 5.19

I use the dns-update command tool to register to a DNS server in a script:

/tool dns-update dns-server=$dnsIP ttl=86400 name=$ssname zone=$zoneDomain address=newIP 
....somenthing to do after dns-update

If the command tool dns-update fail (ex. connection timeout) the script stop his execution and the code after the command is not executed.

How can I avoid this behavior?

Thanks in advance.

I am unaware if there is an official way to avoid this. However, there might a workaround…

Take the dns-update code and put it into a new script. Then, call it from the first script using the undocumented :execute command (http://forum.mikrotik.com/t/resolve-failure/55310/1). Something like this:

Main script:

...
:execute script=dnsUpdate
... run checks to see if script succeeded
...

dnsUpdate script:

/tool dns-update dns-server=$dnsIP ttl=86400 name=$ssname zone=$zoneDomain address=newIP

You could also just run the dns-update command in its own script and use a second script would check to see if the script succeeded and respond accordingly. People have done this with a similar Fetch problem: http://forum.mikrotik.com/t/fetch-status/51447/18

Either way, since you use variables in the dns-update command, I think they will need to be global to pass them between the scripts.