Merge branch 'empty-array' into next

This commit is contained in:
Christian Hesse 2022-07-13 11:57:47 +02:00
commit b67b9ec1c1
19 changed files with 30 additions and 30 deletions

View file

@ -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 ];

View file

@ -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 ];

View file

@ -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 ];

View file

@ -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={

View file

@ -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;

View file

@ -13,7 +13,7 @@
:global SentLteFirmwareUpgradeNotification;
:if ([ :typeof $SentLteFirmwareUpgradeNotification ] != "array") do={
:global SentLteFirmwareUpgradeNotification [ :toarray "" ];
:global SentLteFirmwareUpgradeNotification ({});
}
:local CheckInterface do={

View file

@ -55,7 +55,7 @@ $WaitFullyConnected;
($DailyPskSecrets->2->$WeekDay));
}
:local Seen [ :toarray "" ];
:local Seen ({});
:local Date [ /system/clock/get date ];
:local NewPsk [ $GeneratePSK $Date ];

View file

@ -55,7 +55,7 @@ $WaitFullyConnected;
($DailyPskSecrets->2->$WeekDay));
}
:local Seen [ :toarray "" ];
:local Seen ({});
:local Date [ /system/clock/get date ];
:local NewPsk [ $GeneratePSK $Date ];

View file

@ -56,7 +56,7 @@ $WaitFullyConnected;
($DailyPskSecrets->2->$WeekDay));
}
:local Seen [ :toarray "" ];
:local Seen ({});
:local Date [ /system/clock/get date ];
:local NewPsk [ $GeneratePSK $Date ];

View file

@ -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 ];
}

View file

@ -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 ];

View file

@ -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 . "] " . \

View file

@ -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={

View file

@ -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={

View file

@ -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 ] . \

View file

@ -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 ] . \

View file

@ -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={

View file

@ -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={

View file

@ -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 ];