From 073f43220407d3995bbdf554340a8ba2f089ac94 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:30:06 +0200 Subject: [PATCH 01/15] accesslist-duplicates: update initialization of empty array Having the parenthesis here is important for valid syntax! --- accesslist-duplicates.capsman | 4 ++-- accesslist-duplicates.local | 4 ++-- accesslist-duplicates.template | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/accesslist-duplicates.capsman b/accesslist-duplicates.capsman index e1f83a3..848ca52 100644 --- a/accesslist-duplicates.capsman +++ b/accesslist-duplicates.capsman @@ -14,8 +14,8 @@ :global Read; -:local Seen [ :toarray "" ]; -:local Shown [ :toarray "" ]; +:local Seen ({}); +:local Shown ({}); :foreach AccList in=[ /caps-man/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ :local Mac [ /caps-man/access-list/get $AccList mac-address ]; diff --git a/accesslist-duplicates.local b/accesslist-duplicates.local index c1bf2a2..67f16f3 100644 --- a/accesslist-duplicates.local +++ b/accesslist-duplicates.local @@ -14,8 +14,8 @@ :global Read; -:local Seen [ :toarray "" ]; -:local Shown [ :toarray "" ]; +:local Seen ({}); +:local Shown ({}); :foreach AccList in=[ /interface/wireless/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ :local Mac [ /interface/wireless/access-list/get $AccList mac-address ]; diff --git a/accesslist-duplicates.template b/accesslist-duplicates.template index 8ad8e8f..8676551 100644 --- a/accesslist-duplicates.template +++ b/accesslist-duplicates.template @@ -15,8 +15,8 @@ :global Read; -:local Seen [ :toarray "" ]; -:local Shown [ :toarray "" ]; +:local Seen ({}); +:local Shown ({}); :foreach AccList in=[ /%PATH%/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ :local Mac [ /%PATH%/access-list/get $AccList mac-address ]; From 3006e965988771e5f3aa3e531af7c2f23070c94e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:31:29 +0200 Subject: [PATCH 02/15] backup-email: update initialization of empty array Having the parenthesis here is important for valid syntax! --- backup-email | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup-email b/backup-email index 55f2309..7cdf55e 100644 --- a/backup-email +++ b/backup-email @@ -50,7 +50,7 @@ $WaitFullyConnected; :local FilePath ($0 . "/" . $FileName); :local BackupFile "none"; :local ConfigFile "none"; -:local Attach [ :toarray "" ]; +:local Attach ({}); # binary backup :if ($BackupSendBinary = true) do={ From eae9a7b956a4050caeacb58b6f6176087f3c2b0a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:31:44 +0200 Subject: [PATCH 03/15] check-health: update initialization of empty array Having the parenthesis here is important for valid syntax! --- check-health | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-health b/check-health index 903c496..5da7d2a 100644 --- a/check-health +++ b/check-health @@ -35,10 +35,10 @@ } :if ([ :typeof $CheckHealthLast ] != "array") do={ - :set CheckHealthLast [ :toarray "" ]; + :set CheckHealthLast ({}); } :if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={ - :set CheckHealthTemperatureNotified [ :toarray "" ]; + :set CheckHealthTemperatureNotified ({}); } $ScriptLock $0; From 2d30f4e4629de5a24803d34960c77d60f7490834 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:32:11 +0200 Subject: [PATCH 04/15] check-lte-firmware-upgrade: update initialization of empty array Having the parenthesis here is important for valid syntax! --- check-lte-firmware-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-lte-firmware-upgrade b/check-lte-firmware-upgrade index 759b138..c039dad 100644 --- a/check-lte-firmware-upgrade +++ b/check-lte-firmware-upgrade @@ -13,7 +13,7 @@ :global SentLteFirmwareUpgradeNotification; :if ([ :typeof $SentLteFirmwareUpgradeNotification ] != "array") do={ - :global SentLteFirmwareUpgradeNotification [ :toarray "" ]; + :global SentLteFirmwareUpgradeNotification ({}); } :local CheckInterface do={ From 99a8148d17f5000f7fd4065246eda03dbcbedf58 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:32:23 +0200 Subject: [PATCH 05/15] daily-psk: update initialization of empty array Having the parenthesis here is important for valid syntax! --- daily-psk.capsman | 2 +- daily-psk.local | 2 +- daily-psk.template | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daily-psk.capsman b/daily-psk.capsman index 9f81be5..6e89ff2 100644 --- a/daily-psk.capsman +++ b/daily-psk.capsman @@ -55,7 +55,7 @@ $WaitFullyConnected; ($DailyPskSecrets->2->$WeekDay)); } -:local Seen [ :toarray "" ]; +:local Seen ({}); :local Date [ /system/clock/get date ]; :local NewPsk [ $GeneratePSK $Date ]; diff --git a/daily-psk.local b/daily-psk.local index e2a5886..3876430 100644 --- a/daily-psk.local +++ b/daily-psk.local @@ -55,7 +55,7 @@ $WaitFullyConnected; ($DailyPskSecrets->2->$WeekDay)); } -:local Seen [ :toarray "" ]; +:local Seen ({}); :local Date [ /system/clock/get date ]; :local NewPsk [ $GeneratePSK $Date ]; diff --git a/daily-psk.template b/daily-psk.template index bd457dc..af05cd7 100644 --- a/daily-psk.template +++ b/daily-psk.template @@ -56,7 +56,7 @@ $WaitFullyConnected; ($DailyPskSecrets->2->$WeekDay)); } -:local Seen [ :toarray "" ]; +:local Seen ({}); :local Date [ /system/clock/get date ]; :local NewPsk [ $GeneratePSK $Date ]; From 9a89cd54077dbb77c1130396d6218ec8fa735594 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:32:44 +0200 Subject: [PATCH 06/15] global-functions: update initialization of empty array Having the parenthesis here is important for valid syntax! --- global-functions | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/global-functions b/global-functions index 94f3763..8ef158a 100644 --- a/global-functions +++ b/global-functions @@ -585,7 +585,7 @@ # prepare NotificationFunctions array :if ([ :typeof $NotificationFunctions ] != "array") do={ - :set NotificationFunctions [ :toarray "" ]; + :set NotificationFunctions ({}); } # send notification via e-mail - expects one array argument @@ -612,7 +612,7 @@ } :if ([ :typeof $EmailQueue ] = "nothing") do={ - :set EmailQueue [ :toarray "" ]; + :set EmailQueue ({}); } :local Signature [ /system/note/get note ]; :set ($EmailQueue->[ :len $EmailQueue ]) { @@ -634,7 +634,7 @@ :if ([ :typeof $Source ] != "array") do={ :set Source [ :tostr $1 ]; } - :local Result [ :toarray "" ]; + :local Result ({}); :foreach KeyValue in=[ :toarray $Source ] do={ :if ([ :find $KeyValue "=" ]) do={ :set ($Result->[ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]) \ @@ -974,10 +974,10 @@ :global ScriptLockOrder; :if ([ :typeof $ScriptLockOrder ] = "nothing") do={ - :set ScriptLockOrder [ :toarray "" ]; + :set ScriptLockOrder ({}); } :if ([ :typeof ($ScriptLockOrder->$Script) ] = "nothing") do={ - :set ($ScriptLockOrder->$Script) [ :toarray "" ]; + :set ($ScriptLockOrder->$Script) ({}); } :local JobCount do={ @@ -1052,7 +1052,7 @@ } } - :set ($ScriptLockOrder->$Script) [ :toarray "" ]; + :set ($ScriptLockOrder->$Script) ({}); } :if ([ :len [ /system/script/find where name=$Script ] ] = 0) do={ @@ -1065,7 +1065,7 @@ :if ([ $TicketCount $Script ] >= [ $JobCount $Script ]) do={ $LogPrintExit2 error $0 ("More tickets than running scripts '" . $Script . "', resetting!") false; - :set ($ScriptLockOrder->$Script) [ :toarray "" ]; + :set ($ScriptLockOrder->$Script) ({}); /system/script/job/remove [ find where script=$Script ]; } From 49147c83ca2a52666e2c98762005dfb403e3d149 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:33:38 +0200 Subject: [PATCH 07/15] lease-script: update initialization of empty array Having the parenthesis here is important for valid syntax! --- lease-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lease-script b/lease-script index fa03e11..cc1b6e5 100644 --- a/lease-script +++ b/lease-script @@ -31,7 +31,7 @@ $ScriptLock $0 false 10; $LogPrintExit2 debug $0 ("More invocations are waiting, exiting early.") true; } -:local RunOrder [ :toarray "" ]; +:local RunOrder ({}); :foreach Script in=[ /system/script/find where source~("\n# provides: lease-script, ") ] do={ :local Name [ /system/script/get $Script name ]; From 164ebe8c8ac57800af31c27d49d45a042fa96d8e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:33:58 +0200 Subject: [PATCH 08/15] log-forward: update initialization of empty array Having the parenthesis here is important for valid syntax! --- log-forward | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log-forward b/log-forward index 63c7ea7..6ccad4f 100644 --- a/log-forward +++ b/log-forward @@ -46,7 +46,7 @@ $ScriptLock $0; :local Messages ""; :local Warning false; :local MessageVal; -:local MessageDups [ :toarray "" ]; +:local MessageDups ({}); :local LogForwardFilterLogForwarding ("^Error sending e-mail <(" . \ [ $EscapeForRegEx [ $QuotedPrintable ("[" . $Identity . "] " . \ From 8436a189191060429fe3296aaafd9376ed9ad966 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:34:25 +0200 Subject: [PATCH 09/15] mod/bridge-port-to: update initialization of empty array Having the parenthesis here is important for valid syntax! --- mod/bridge-port-to | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/bridge-port-to b/mod/bridge-port-to index ae74824..3f62e6f 100644 --- a/mod/bridge-port-to +++ b/mod/bridge-port-to @@ -15,7 +15,7 @@ :global LogPrintExit2; :global ParseKeyValueStore; - :local InterfaceReEnable [ :toarray "" ]; + :local InterfaceReEnable ({}); :foreach BridgePort in=[ /interface/bridge/port/find where !(comment=[]) ] do={ :local BridgePortVal [ /interface/bridge/port/get $BridgePort ]; :foreach Config,BridgeDefault in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={ From 34ea2764695ad008fbb1ea4308160584491e7bc5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:34:37 +0200 Subject: [PATCH 10/15] mod/bridge-port-vlan: update initialization of empty array Having the parenthesis here is important for valid syntax! --- mod/bridge-port-vlan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/bridge-port-vlan b/mod/bridge-port-vlan index a43d7d7..9a6e08a 100644 --- a/mod/bridge-port-vlan +++ b/mod/bridge-port-vlan @@ -15,7 +15,7 @@ :global LogPrintExit2; :global ParseKeyValueStore; - :local InterfaceReEnable [ :toarray "" ]; + :local InterfaceReEnable ({}); :foreach BridgePort in=[ /interface/bridge/port/find where !(comment=[]) ] do={ :local BridgePortVal [ /interface/bridge/port/get $BridgePort ]; :foreach Config,Vlan in=[ $ParseKeyValueStore ($BridgePortVal->"comment") ] do={ From 7f85e6971332f1c6f628fe04b9da7a36c59bd2d7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:34:51 +0200 Subject: [PATCH 11/15] mod/notification-matrix: update initialization of empty array Having the parenthesis here is important for valid syntax! --- mod/notification-matrix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/notification-matrix b/mod/notification-matrix index f905839..c4dd27b 100644 --- a/mod/notification-matrix +++ b/mod/notification-matrix @@ -129,7 +129,7 @@ $LogPrintExit2 info $0 ("Failed sending Matrix notification! Queuing...") false; :if ([ :typeof $MatrixQueue ] = "nothing") do={ - :set MatrixQueue [ :toarray "" ]; + :set MatrixQueue ({}); } :local Text ([ $SymbolForNotification "alarm-clock" ] . \ "This message was queued since " . [ /system/clock/get date ] . \ From f34c353b5f575bdaf20c7cd2a372e0118362d815 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:35:03 +0200 Subject: [PATCH 12/15] mod/notification-telegram: update initialization of empty array Having the parenthesis here is important for valid syntax! --- mod/notification-telegram | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/notification-telegram b/mod/notification-telegram index 493aa00..8c4cd65 100644 --- a/mod/notification-telegram +++ b/mod/notification-telegram @@ -139,7 +139,7 @@ $LogPrintExit2 info $0 ("Failed sending telegram notification! Queuing...") false; :if ([ :typeof $TelegramQueue ] = "nothing") do={ - :set TelegramQueue [ :toarray "" ]; + :set TelegramQueue ({}); } :set Text ($Text . [ $UrlEncode ("\n" . [ $SymbolForNotification "alarm-clock" ] . \ [ $EscapeMD ("This message was queued since " . [ /system/clock/get date ] . \ From 8a85a258fc787932c7c00423091bb758ec9cbe02 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:35:18 +0200 Subject: [PATCH 13/15] netwatch-dns: update initialization of empty array Having the parenthesis here is important for valid syntax! --- netwatch-dns | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netwatch-dns b/netwatch-dns index 82a8599..7ec1bb4 100644 --- a/netwatch-dns +++ b/netwatch-dns @@ -21,8 +21,8 @@ $ScriptLock $0; $LogPrintExit2 info $0 ("System just booted, giving netwatch some time to settle.") true; } -:local DnsServers [ :toarray "" ]; -:local DnsFallback [ :toarray "" ]; +:local DnsServers ({}); +:local DnsFallback ({}); :local DnsCurrent [ /ip/dns/get servers ]; :foreach Host in=[ /tool/netwatch/find where comment~"dns" !disabled ] do={ From d6337fcc9733b6a780cf44d2b367f1700464507e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:35:32 +0200 Subject: [PATCH 14/15] netwatch-notify: update initialization of empty array Having the parenthesis here is important for valid syntax! --- netwatch-notify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwatch-notify b/netwatch-notify index a725fc3..3b84a06 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -56,7 +56,7 @@ $ScriptLock $0; } :if ([ :typeof $NetwatchNotify ] = "nothing") do={ - :set NetwatchNotify [ :toarray "" ]; + :set NetwatchNotify ({}); } :foreach Host in=[ /tool/netwatch/find where comment~"notify" !disabled ] do={ From 6fa15257003394d495f84a8dedebadfa8e1fa375 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Jul 2022 11:35:46 +0200 Subject: [PATCH 15/15] sms-forward: update initialization of empty array Having the parenthesis here is important for valid syntax! --- sms-forward | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sms-forward b/sms-forward index b392805..aa2e71c 100644 --- a/sms-forward +++ b/sms-forward @@ -33,7 +33,7 @@ $WaitFullyConnected; :while ([ :len [ /tool/sms/inbox/find ] ] > 0) do={ :local Phone [ /tool/sms/inbox/get ([ find ]->0) phone ]; :local Messages ""; - :local Delete [ :toarray "" ]; + :local Delete ({}); :foreach Sms in=[ /tool/sms/inbox/find where phone=$Phone ] do={ :local SmsVal [ /tool/sms/inbox/get $Sms ];