mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-03 17:54:35 +02:00
add script 'global-wait'
Run this in schedulers that fire on startup without interval. Schedulers should look something like this: / system scheduler { add name=global-scripts on-event="/ system script { run global-config; run global-config-overlay; run global-functions; }" start-time=startup; add name=bridge-port-to-default on-event="/ system script { run global-wait; run bridge-port-to-default; }" start-time=startup; }
This commit is contained in:
parent
63ed093340
commit
98585afe1c
3 changed files with 17 additions and 2 deletions
|
@ -36,9 +36,9 @@
|
|||
:if ($SchedulerVal->"name" != "global-scripts" && \
|
||||
$SchedulerVal->"start-time" = "startup" && \
|
||||
$SchedulerVal->"interval" = 0s && \
|
||||
[ :pick ($SchedulerVal->"on-event") 0 7 ] != ":delay ") do={
|
||||
!(($SchedulerVal->"on-event") ~ "\\brun global-wait\\b")) do={
|
||||
$LogPrintExit warning ("Scheduler " . $SchedulerVal->"name" . " starts on startup, " . \
|
||||
"without interval. Add delay to make sure the configuration is available!") false;
|
||||
"without waiting for global-functions. Run 'global-wait' to avoid race conditions!") false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue