aboutsummaryrefslogtreecommitdiffstats
path: root/dhcp-lease-comment.template.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp-lease-comment.template.rsc')
-rw-r--r--dhcp-lease-comment.template.rsc20
1 files changed, 10 insertions, 10 deletions
diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc
index 8f1ad47..62cace1 100644
--- a/dhcp-lease-comment.template.rsc
+++ b/dhcp-lease-comment.template.rsc
@@ -1,22 +1,22 @@
#!rsc by RouterOS
# RouterOS script: dhcp-lease-comment%TEMPL%
-# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
-# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
+# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
+# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=60
-# requires RouterOS, version=7.14
+# requires RouterOS, version=7.15
#
# update dhcp-server lease comment with infos from access-list
-# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
+# https://rsc.eworm.de/doc/dhcp-lease-comment.md
#
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:global GlobalFunctionsReady;
-:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-
:local ExitOK false;
-:do {
+:onerror Err {
+ :global GlobalConfigReady; :global GlobalFunctionsReady;
+ :retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
+ do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
:local ScriptName [ :jobname ];
:global LogPrint;
@@ -43,6 +43,6 @@
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
}
}
-} on-error={
- :global ExitError; $ExitError $ExitOK [ :jobname ];
+} do={
+ :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
}