global-functions: make the scheduler fix a block

This commit is contained in:
Christian Hesse 2026-01-20 16:19:54 +01:00
parent b7a5402be6
commit 74be3eae5d

View file

@ -1921,12 +1921,14 @@
} }
# add (and fix) global scripts scheduler # add (and fix) global scripts scheduler
:local OnEvent "/system/script { run global-config; run global-functions; }"; /system/scheduler {
:if ([ :len [ /system/scheduler/find where name="global-scripts" ] ] = 0) do={ :local OnEvent "/system/script { run global-config; run global-functions; }";
/system/scheduler/add name="global-scripts" start-time=startup; :if ([ :len [ find where name="global-scripts" ] ] = 0) do={
} add name="global-scripts" start-time=startup;
:if ([ /system/scheduler/get "global-scripts" on-event ] != $OnEvent) do={ }
/system/scheduler/set "global-scripts" on-event=$OnEvent; :if ([ get "global-scripts" on-event ] != $OnEvent) do={
set "global-scripts" on-event=$OnEvent;
}
} }
# Log success # Log success