mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-01 08:44:32 +02:00
mod/notification-email: $FlushEmailQueue: create scheduler if missing...
... as it is required to be modified several times below.
This commit is contained in:
parent
5310673152
commit
1e2ca3d214
1 changed files with 8 additions and 2 deletions
|
@ -46,9 +46,15 @@
|
|||
:local AllDone true;
|
||||
:local QueueLen [ :len $EmailQueue ];
|
||||
:local Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ];
|
||||
:local SchedVal [ /system/scheduler/get $Scheduler ];
|
||||
|
||||
:if ([ :len $Scheduler ] > 0 && ($SchedVal->"interval") < 1m) do={
|
||||
:if ([ :len $Scheduler ] < 0) do={
|
||||
/system/scheduler/add name="_FlushEmailQueue" interval=1m start-time=startup \
|
||||
comment="Doing initial checks..." on-event=(":global FlushEmailQueue; \$FlushEmailQueue;");
|
||||
:set Scheduler [ /system/scheduler/find where name="_FlushEmailQueue" ];
|
||||
}
|
||||
|
||||
:local SchedVal [ /system/scheduler/get $Scheduler ];
|
||||
:if (($SchedVal->"interval") < 1m) do={
|
||||
/system/scheduler/set interval=1m comment="Doing initial checks..." $Scheduler;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue