From 87cde2cc2fe8604457f9fd4826abac1409d88a0d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Dec 2024 10:31:52 +0100 Subject: dhcp-lease-comment: use $ExitError to indicate unintentional error --- dhcp-lease-comment.local.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dhcp-lease-comment.local.rsc') diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc index 27e6605..1b74d93 100644 --- a/dhcp-lease-comment.local.rsc +++ b/dhcp-lease-comment.local.rsc @@ -14,6 +14,7 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } +:local ExitOK false; :do { :local ScriptName [ :jobname ]; @@ -21,6 +22,7 @@ :global ScriptLock; :if ([ $ScriptLock $ScriptName ] = false) do={ + :set ExitOK true; :error false; } @@ -36,4 +38,6 @@ /ip/dhcp-server/lease/set comment=$NewComment $Lease; } } -} on-error={ } +} on-error={ + :global ExitError; $ExitError $ExitOK [ :jobname ]; +} -- cgit v1.2.3-70-g09d2