From 98585afe1cc068203e5d713eb9965c930ac762de Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 12 Mar 2020 08:40:29 +0100 Subject: 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; } --- script-updates | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script-updates') diff --git a/script-updates b/script-updates index 6ecdd37..38165c9 100644 --- a/script-updates +++ b/script-updates @@ -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; } } -- cgit v1.2.3-54-g00ecf