dhcp-lease-comment: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:11:57 +01:00
parent b163e28402
commit 999dc1798d
5 changed files with 13 additions and 21 deletions

View file

@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: dhcpv4-server-lease, order=60
# requires RouterOS, version=7.19
# requires RouterOS, version=7.22
#
# update dhcp-server lease comment with infos from access-list
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
#
# !! Do not edit this file, it is generated from template!
:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -22,8 +21,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true;
:error false;
:exit;
}
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
@ -39,5 +37,5 @@
}
}
} do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
}