From 19802c0b6977f9467fada4ace3cab017dd98964b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 8 Mar 2024 11:09:22 +0100 Subject: global-functions: $LogPrintOnce: drop support for exit This is not widely adopted or used, so let's just drop it - no compatibility. --- dhcp-to-dns.rsc | 4 ++-- fw-addr-lists.rsc | 2 +- global-functions.rsc | 9 ++++----- sms-forward.rsc | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 84a1e84..d0638c7 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -61,7 +61,7 @@ :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 $ScriptName ("Multiple bound leases found for mac-address " . ($LeaseVal->"active-mac-address") . "!") false; + $LogPrintOnce info $ScriptName ("Multiple bound leases found for mac-address " . ($LeaseVal->"active-mac-address") . "!"); } } on-error={ $LogPrintExit2 debug $ScriptName ("A lease just vanished, ignoring.") false; @@ -117,7 +117,7 @@ } :if ([ :len [ /ip/dns/static/find where name=$FullA (!type or type=A) ] ] > 1) do={ - $LogPrintOnce warning $ScriptName ("The name '" . $FullA . "' appeared in more than one A record!") false; + $LogPrintOnce warning $ScriptName ("The name '" . $FullA . "' appeared in more than one A record!"); } } else={ $LogPrintExit2 debug $ScriptName ("No address available... Ignoring.") false; diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 6071f7b..4ec4105 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -82,7 +82,7 @@ } :if ([ :len $Data ] > 63000) do={ - $LogPrintOnce warning $ScriptName ("The list is huge and may be truncated: " . $List->"url") false; + $LogPrintOnce warning $ScriptName ("The list is huge and may be truncated: " . $List->"url"); } :while ([ :len $Data ] != 0) do={ diff --git a/global-functions.rsc b/global-functions.rsc index 1c2523a..aca4cd8 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -703,7 +703,6 @@ :local Severity [ :tostr $1 ]; :local Name [ :tostr $2 ]; :local Message [ :tostr $3 ]; - :local Exit [ :tostr $4 ]; :global LogPrintExit2; @@ -718,7 +717,7 @@ } :set ($LogPrintOnceMessages->$Message) 1; - $LogPrintExit2 $Severity $Name $Message $Exit; + $LogPrintExit2 $Severity $Name $Message false; } # get max value @@ -1048,7 +1047,7 @@ } } else={ $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires RouterOS " . \ - $Required . ", which is not met by your installation. Ignoring!") false; + $Required . ", which is not met by your installation. Ignoring!"); } } else={ $LogPrintExit2 warning $0 ("Looks like new script '" . $ScriptVal->"name" . \ @@ -1359,7 +1358,7 @@ } :if ([ :len ($Symbols->$Name) ] = 0) do={ - $LogPrintOnce warning $0 ("No symbol available for name '" . $Name . "'!") false; + $LogPrintOnce warning $0 ("No symbol available for name '" . $Name . "'!"); :return ""; } @@ -1540,7 +1539,7 @@ # Log success :local Resource [ /system/resource/get ]; $LogPrintOnce info $ScriptName ("Loaded on " . $Resource->"board-name" . \ - " with RouterOS " . $Resource->"version" . ".") false; + " with RouterOS " . $Resource->"version" . "."); # signal we are ready :set GlobalFunctionsReady true; diff --git a/sms-forward.rsc b/sms-forward.rsc index 2f549b1..c745b81 100644 --- a/sms-forward.rsc +++ b/sms-forward.rsc @@ -32,7 +32,8 @@ } :if ([ /tool/sms/get receive-enabled ] = false) do={ - $LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled.") true; + $LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled."); + :error false; } $WaitFullyConnected; -- cgit v1.2.3-70-g09d2