From a7619a51195effef1f4c2f8aa8e8151c6e0e1094 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 18 Jan 2024 10:13:53 +0100 Subject: global-functions: $LogPrintOnce: support exit --- dhcp-to-dns.rsc | 4 ++-- fw-addr-lists.rsc | 2 +- global-functions.rsc | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 78e7639..38e8c79 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -56,7 +56,7 @@ $ScriptLock $0 false 10; :do { :set LeaseVal [ /ip/dhcp-server/lease/get $Lease ]; :if ([ :len [ /ip/dhcp-server/lease/find where active-mac-address=($LeaseVal->"active-mac-address") status=bound ] ] > 1) do={ - $LogPrintOnce info $0 ("Multiple bound leases found for mac-address " . ($LeaseVal->"active-mac-address") . "!"); + $LogPrintOnce info $0 ("Multiple bound leases found for mac-address " . ($LeaseVal->"active-mac-address") . "!") false; } } on-error={ $LogPrintExit2 debug $0 ("A lease just vanished, ignoring.") false; @@ -112,7 +112,7 @@ $ScriptLock $0 false 10; } :if ([ :len [ /ip/dns/static/find where name=$FullA (!type or type=A) ] ] > 1) do={ - $LogPrintOnce warning $0 ("The name '" . $FullA . "' appeared in more than one A record!"); + $LogPrintOnce warning $0 ("The name '" . $FullA . "' appeared in more than one A record!") false; } } else={ $LogPrintExit2 debug $0 ("No address available... Ignoring.") false; diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 35f9a00..fec3729 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -74,7 +74,7 @@ $WaitFullyConnected; } :if ([ :len $Data ] > 63000) do={ - $LogPrintOnce warning $0 ("The list is huge and may be truncated: " . $List->"url"); + $LogPrintOnce warning $0 ("The list is huge and may be truncated: " . $List->"url") false; } :while ([ :len $Data ] != 0) do={ diff --git a/global-functions.rsc b/global-functions.rsc index af82fa8..3d66259 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -681,6 +681,7 @@ :local Severity [ :tostr $1 ]; :local Name [ :tostr $2 ]; :local Message [ :tostr $3 ]; + :local Exit [ :tostr $4 ]; :global LogPrintExit2; @@ -695,7 +696,7 @@ } :set ($LogPrintOnceMessages->$Message) 1; - $LogPrintExit2 $Severity $Name $Message false; + $LogPrintExit2 $Severity $Name $Message $Exit; } # get max value -- cgit v1.2.3-54-g00ecf