aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-11-14 22:36:58 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-11-14 22:36:58 +0100
commit3aec5d70c628003634fc413cdb00b2e1e0c9fca5 (patch)
tree1f00be1798a0a39e578f6f0af1d68bc68cd16d9d
parent0d530294f5f0608114c8f0cd409f0041bb2c1b74 (diff)
parent8c8f834179f0ab618f031ec50739bbafd4c4261e (diff)
Merge branch 'scheduler' into nextrouteros-7.13beta1-1
-rw-r--r--mod/notification-email.rsc8
-rw-r--r--mod/notification-matrix.rsc10
-rw-r--r--mod/notification-ntfy.rsc10
-rw-r--r--mod/notification-telegram.rsc10
-rw-r--r--mode-button.rsc10
-rw-r--r--packages-update.rsc4
6 files changed, 26 insertions, 26 deletions
diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc
index a505a50..774af4c 100644
--- a/mod/notification-email.rsc
+++ b/mod/notification-email.rsc
@@ -26,7 +26,7 @@
:local AllDone true;
:local QueueLen [ :len $EmailQueue ];
- :local Scheduler [ /system/scheduler/find where name=$0 ];
+ :local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ];
:if ([ :len $Scheduler ] > 0 && [ /system/scheduler/get $Scheduler interval ] < 1m) do={
/system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler;
@@ -152,8 +152,8 @@
[ $IfThenElse ([ :len ($Notification->"link") ] > 0) ("\n\n" . ($Notification->"link")) "" ] . \
[ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]); \
attach=($Notification->"attach"); remove-attach=($Notification->"remove-attach") };
- :if ([ :len [ /system/scheduler/find where name="\$FlushEmailQueue" ] ] = 0) do={
- /system/scheduler/add name="\$FlushEmailQueue" interval=1s start-time=startup \
+ :if ([ :len [ /system/scheduler/find where name="_FlushEmailQueue" ] ] = 0) do={
+ /system/scheduler/add name="_FlushEmailQueue" interval=1s start-time=startup \
comment="Queuing new mail..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;");
}
}
@@ -162,7 +162,7 @@
:set PurgeEMailQueue do={
:global EmailQueue;
- /system/scheduler/remove [ find where name="\$FlushEmailQueue" ];
+ /system/scheduler/remove [ find where name="_FlushEmailQueue" ];
:set EmailQueue;
}
diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc
index a8983a7..378faab 100644
--- a/mod/notification-matrix.rsc
+++ b/mod/notification-matrix.rsc
@@ -30,7 +30,7 @@
:local AllDone true;
:local QueueLen [ :len $MatrixQueue ];
- :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={
+ :if ([ :len [ /system/scheduler/find where name="_FlushMatrixQueue" ] ] > 0 && $QueueLen = 0) do={
$LogPrintExit2 warning $0 ("Flushing Matrix messages from scheduler, but queue is empty.") false;
}
@@ -52,7 +52,7 @@
}
:if ($AllDone = true && $QueueLen = [ :len $MatrixQueue ]) do={
- /system/scheduler/remove [ find where name=$0 ];
+ /system/scheduler/remove [ find where name="_FlushMatrixQueue" ];
:set MatrixQueue;
}
}
@@ -147,8 +147,8 @@
:set ($MatrixQueue->[ :len $MatrixQueue ]) { room=$Room; \
accesstoken=$AccessToken; homeserver=$HomeServer; \
plain=$Plain; formatted=$Formatted };
- :if ([ :len [ /system/scheduler/find where name="\$FlushMatrixQueue" ] ] = 0) do={
- /system/scheduler/add name="\$FlushMatrixQueue" interval=1m start-time=startup \
+ :if ([ :len [ /system/scheduler/find where name="_FlushMatrixQueue" ] ] = 0) do={
+ /system/scheduler/add name="_FlushMatrixQueue" interval=1m start-time=startup \
on-event=(":global FlushMatrixQueue; \$FlushMatrixQueue;");
}
}
@@ -158,7 +158,7 @@
:set PurgeMatrixQueue do={
:global MatrixQueue;
- /system/scheduler/remove [ find where name="\$FlushMatrixQueue" ];
+ /system/scheduler/remove [ find where name="_FlushMatrixQueue" ];
:set MatrixQueue;
}
diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc
index e2fc558..5c0e9e5 100644
--- a/mod/notification-ntfy.rsc
+++ b/mod/notification-ntfy.rsc
@@ -28,7 +28,7 @@
:local AllDone true;
:local QueueLen [ :len $NtfyQueue ];
- :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={
+ :if ([ :len [ /system/scheduler/find where name="_FlushNtfyQueue" ] ] > 0 && $QueueLen = 0) do={
$LogPrintExit2 warning $0 ("Flushing Ntfy messages from scheduler, but queue is empty.") false;
}
@@ -46,7 +46,7 @@
}
:if ($AllDone = true && $QueueLen = [ :len $NtfyQueue ]) do={
- /system/scheduler/remove [ find where name=$0 ];
+ /system/scheduler/remove [ find where name="_FlushNtfyQueue" ];
:set NtfyQueue;
}
}
@@ -103,8 +103,8 @@
"This message was queued since " . [ /system/clock/get date ] . " " . \
[ /system/clock/get time ] . " and may be obsolete.");
:set ($NtfyQueue->[ :len $NtfyQueue ]) { url=$Url; headers=$Headers; text=$Text };
- :if ([ :len [ /system/scheduler/find where name="\$FlushNtfyQueue" ] ] = 0) do={
- /system/scheduler/add name="\$FlushNtfyQueue" interval=1m start-time=startup \
+ :if ([ :len [ /system/scheduler/find where name="_FlushNtfyQueue" ] ] = 0) do={
+ /system/scheduler/add name="_FlushNtfyQueue" interval=1m start-time=startup \
on-event=(":global FlushNtfyQueue; \$FlushNtfyQueue;");
}
}
@@ -114,7 +114,7 @@
:set PurgeNtfyQueue do={
:global NtfyQueue;
- /system/scheduler/remove [ find where name="\$FlushNtfyQueue" ];
+ /system/scheduler/remove [ find where name="_FlushNtfyQueue" ];
:set NtfyQueue;
}
diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc
index b5729a4..66be7d3 100644
--- a/mod/notification-telegram.rsc
+++ b/mod/notification-telegram.rsc
@@ -29,7 +29,7 @@
:local AllDone true;
:local QueueLen [ :len $TelegramQueue ];
- :if ([ :len [ /system/scheduler/find where name=$0 ] ] > 0 && $QueueLen = 0) do={
+ :if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] > 0 && $QueueLen = 0) do={
$LogPrintExit2 warning $0 ("Flushing Telegram messages from scheduler, but queue is empty.") false;
}
@@ -51,7 +51,7 @@
}
:if ($AllDone = true && $QueueLen = [ :len $TelegramQueue ]) do={
- /system/scheduler/remove [ find where name=$0 ];
+ /system/scheduler/remove [ find where name="_FlushTelegramQueue" ];
:set TelegramQueue;
}
}
@@ -155,8 +155,8 @@
" " . [ /system/clock/get time ] . " and may be obsolete.") "plain" ]) ]);
:set ($TelegramQueue->[ :len $TelegramQueue ]) { chatid=$ChatId; tokenid=$TokenId;
text=$Text; silent=($Notification->"silent"); replyto=($Notification->"replyto") };
- :if ([ :len [ /system/scheduler/find where name="\$FlushTelegramQueue" ] ] = 0) do={
- /system/scheduler/add name="\$FlushTelegramQueue" interval=1m start-time=startup \
+ :if ([ :len [ /system/scheduler/find where name="_FlushTelegramQueue" ] ] = 0) do={
+ /system/scheduler/add name="_FlushTelegramQueue" interval=1m start-time=startup \
on-event=(":global FlushTelegramQueue; \$FlushTelegramQueue;");
}
}
@@ -166,7 +166,7 @@
:set PurgeTelegramQueue do={
:global TelegramQueue;
- /system/scheduler/remove [ find where name="\$FlushTelegramQueue" ];
+ /system/scheduler/remove [ find where name="_FlushTelegramQueue" ];
:set TelegramQueue;
}
diff --git a/mode-button.rsc b/mode-button.rsc
index 87e8740..dae9d99 100644
--- a/mode-button.rsc
+++ b/mode-button.rsc
@@ -16,10 +16,10 @@
:set ($ModeButton->"count") ($ModeButton->"count" + 1);
-:local Scheduler [ /system/scheduler/find where name="\$ModeButtonScheduler" ];
+:local Scheduler [ /system/scheduler/find where name="_ModeButtonScheduler" ];
:if ([ :len $Scheduler ] = 0) do={
- $LogPrintExit2 info $0 ("Creating scheduler \$ModeButtonScheduler, counting presses...") false;
+ $LogPrintExit2 info $0 ("Creating scheduler _ModeButtonScheduler, counting presses...") false;
:global ModeButtonScheduler do={
:global ModeButton;
@@ -44,7 +44,7 @@
:set ($ModeButton->"count") 0;
:set ModeButtonScheduler;
- /system/scheduler/remove [ find where name=$0 ];
+ /system/scheduler/remove [ find where name="_ModeButtonScheduler" ];
:if ([ :len $Code ] > 0) do={
:if ([ $ValidateSyntax $Code ] = true) do={
@@ -68,9 +68,9 @@
$LogPrintExit2 info $0 ("No action defined for " . $Count . " mode-button presses.") false;
}
}
- /system/scheduler/add name="\$ModeButtonScheduler" \
+ /system/scheduler/add name="_ModeButtonScheduler" \
on-event=":global ModeButtonScheduler; \$ModeButtonScheduler;" interval=3s;
} else={
- $LogPrintExit2 debug $0 ("Updating scheduler \$ModeButtonScheduler...") false;
+ $LogPrintExit2 debug $0 ("Updating scheduler _ModeButtonScheduler...") false;
/system/scheduler/set $Scheduler start-time=[ /system/clock/get time ];
}
diff --git a/packages-update.rsc b/packages-update.rsc
index caaac6a..85a241a 100644
--- a/packages-update.rsc
+++ b/packages-update.rsc
@@ -95,8 +95,8 @@ $ScriptLock $0;
$RandomDelay 3600;
/system/reboot;
}
- /system/scheduler/add name="\$RebootForUpdate" start-time=03:00:00 interval=1d \
- on-event=("/system/scheduler/remove \"\\\$RebootForUpdate\"; " . \
+ /system/scheduler/add name="_RebootForUpdate" start-time=03:00:00 interval=1d \
+ on-event=("/system/scheduler/remove \"_RebootForUpdate\"; " . \
":global RebootForUpdate; \$RebootForUpdate;");
$LogPrintExit2 info $0 ("Scheduled reboot for update between 03:00 and 04:00.") true;
}