dhcp-to-dns: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:12:42 +01:00
parent 92584838be
commit fd52220591
2 changed files with 4 additions and 6 deletions

View file

@ -4,12 +4,11 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: dhcpv4-server-lease, order=20
# requires RouterOS, version=7.19
# requires RouterOS, version=7.22
#
# check DHCP leases and add/remove/update DNS entries
# https://rsc.eworm.de/doc/dhcp-to-dns.md
:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -28,8 +27,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
:set ExitOK true;
:error false;
:exit;
}
:local Ttl 5m;
@ -125,5 +123,5 @@
}
}
} do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
}