mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 16:24:25 +02:00
global-config: load overlay automatically
This commit is contained in:
parent
8f8130775f
commit
1f5cc39b3c
4 changed files with 14 additions and 6 deletions
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
@ -99,8 +99,8 @@ Save changes and exit with `Ctrl-o`.
|
|||
|
||||
And finally load configuration and functions and add the scheduler.
|
||||
|
||||
/ system script { run global-config; run global-config-overlay; run global-functions; };
|
||||
/ system scheduler add name="global-scripts" start-time=startup on-event="/ system script { run global-config; run global-config-overlay; 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; }";
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -193,3 +193,11 @@
|
|||
"cert1-cn"="v3ry-s3cr3t";
|
||||
"cert2-cn"="4n0th3r-s3cr3t";
|
||||
}
|
||||
|
||||
# load custom settings from overlay
|
||||
# Warning: Do *NOT* copy this code to overlay!
|
||||
:do {
|
||||
/ system script run global-config-overlay;
|
||||
} on-error={
|
||||
:log error ("Loading configuration from overlay failed!");
|
||||
}
|
||||
|
|
|
@ -777,11 +777,11 @@
|
|||
}
|
||||
|
||||
:if ($ReloadGlobalConfig = true) do={
|
||||
$LogPrintExit2 info $0 ("Reloading global configuration and overlay.") false;
|
||||
$LogPrintExit2 info $0 ("Reloading global configuration.") false;
|
||||
:do {
|
||||
/ system script { run global-config; run global-config-overlay; }
|
||||
/ system script run global-config;
|
||||
} on-error={
|
||||
$LogPrintExit2 error $0 ("Reloading global configuration and overlay failed!" . \
|
||||
$LogPrintExit2 error $0 ("Reloading global configuration failed!" . \
|
||||
" Syntax error or missing overlay\?") false;
|
||||
}
|
||||
}
|
||||
|
@ -838,7 +838,7 @@
|
|||
:local NotificationMessage ("Current configuration on " . $Identity . \
|
||||
" is out of date. Please update global-config-overlay, then increase " . \
|
||||
"\$GlobalConfigVersion (currently " . $GlobalConfigVersion . \
|
||||
") to " . $ExpectedConfigVersion . " and re-run global-config-overlay.");
|
||||
") to " . $ExpectedConfigVersion . " and re-run global-config.");
|
||||
$LogPrintExit2 info $0 ($NotificationMessage) false;
|
||||
|
||||
:if ([ :len $GlobalConfigChanges ] > 0) do={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue