mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-08 19:09:29 +00:00
global-functions: add and fix global scheduler automatically...
... and also adjust README and INITIAL-COMMANDS.
This commit is contained in:
parent
f5fe673605
commit
174de528af
5 changed files with 12 additions and 6 deletions
|
|
@ -1900,6 +1900,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
# add (and fix) global scripts scheduler
|
||||
:local OnEvent "/system/script { run global-config; run global-functions; }";
|
||||
:if ([ :len [ /system/scheduler/find where name="global-scripts" ] ] = 0) do={
|
||||
/system/scheduler/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;
|
||||
}
|
||||
|
||||
# Log success
|
||||
:local Resource [ /system/resource/get ];
|
||||
$LogPrintOnce info $ScriptName ("Loaded on " . $Resource->"board-name" . \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue