mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 18:09:28 +00:00
global-functions: add and fix global scheduler automatically...
... and also adjust README and INITIAL-COMMANDS.
This commit is contained in:
parent
097c158ec8
commit
02a7b15d0e
5 changed files with 12 additions and 6 deletions
|
|
@ -45,9 +45,6 @@ Run the complete base installation:
|
||||||
};
|
};
|
||||||
:put "Loading configuration and functions...";
|
:put "Loading configuration and functions...";
|
||||||
/system/script { run global-config; run global-functions; };
|
/system/script { run global-config; run global-functions; };
|
||||||
:put "Scheduling to load configuration and functions...";
|
|
||||||
/system/scheduler/remove [ find where name="global-scripts" ];
|
|
||||||
/system/scheduler/add name="global-scripts" start-time=startup on-event="/system/script { run global-config; run global-functions; }";
|
|
||||||
:if ([ :len [ /certificate/find where fingerprint=$CertFingerprint ] ] > 0) do={
|
:if ([ :len [ /certificate/find where fingerprint=$CertFingerprint ] ] > 0) do={
|
||||||
:put "Renaming certificate by its common-name...";
|
:put "Renaming certificate by its common-name...";
|
||||||
:global CertificateNameByCN;
|
:global CertificateNameByCN;
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
README.d/05-run-scripts.avif
Normal file
BIN
README.d/05-run-scripts.avif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -129,12 +129,12 @@ Now let's download the main scripts and add them in configuration on the fly.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
And finally load configuration and functions and add the scheduler.
|
And finally run configuration and functions. This will also add the
|
||||||
|
scheduler for loading at system startup automatically.
|
||||||
|
|
||||||
/system/script { run global-config; run global-functions; };
|
/system/script { run global-config; run global-functions; };
|
||||||
/system/scheduler/add name="global-scripts" start-time=startup on-event="/system/script { run global-config; run global-functions; }";
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> 💡️ **Hint**: You see complaints regarding syntax errors? Most likely the
|
> 💡️ **Hint**: You see complaints regarding syntax errors? Most likely the
|
||||||
> RouterOS on your device is too old. Check for updates!
|
> RouterOS on your device is too old. Check for updates!
|
||||||
|
|
|
||||||
|
|
@ -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
|
# Log success
|
||||||
:local Resource [ /system/resource/get ];
|
:local Resource [ /system/resource/get ];
|
||||||
$LogPrintOnce info $ScriptName ("Loaded on " . $Resource->"board-name" . \
|
$LogPrintOnce info $ScriptName ("Loaded on " . $Resource->"board-name" . \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue