aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions19
1 files changed, 12 insertions, 7 deletions
diff --git a/global-functions b/global-functions
index cf4ad7a..ab95f3f 100644
--- a/global-functions
+++ b/global-functions
@@ -710,6 +710,7 @@
:local ExpectedConfigVersionBefore $ExpectedConfigVersion;
:local ReloadGlobalFunctions false;
+ :local ReloadGlobalConfig false;
:local ScriptInstallUpdateBefore [ :tostr $ScriptInstallUpdate ];
:foreach Script in=[ / system script find where source~"^#!rsc( by RouterOS)\?\n" ] do={
@@ -760,13 +761,7 @@
/ system script set owner=($ScriptVal->"name") source=$SourceNew \
dont-require-permissions=$DontRequirePermissions $Script;
:if ($ScriptVal->"name" = "global-config") do={
- $LogPrintExit2 info $0 ("Reloading global configuration and overlay.") false;
- :do {
- / system script { run global-config; run global-config-overlay; }
- } on-error={
- $LogPrintExit2 error $0 ("Reloading global configuration and overlay failed!" . \
- " Syntax error or missing overlay\?") false;
- }
+ :set ReloadGlobalConfig true;
}
:if ($ScriptVal->"name" ~ "^global-functions(\$|\\.d/.)") do={
:set ReloadGlobalFunctions true;
@@ -796,6 +791,16 @@
}
}
+ :if ($ReloadGlobalConfig = true) do={
+ $LogPrintExit2 info $0 ("Reloading global configuration and overlay.") false;
+ :do {
+ / system script { run global-config; run global-config-overlay; }
+ } on-error={
+ $LogPrintExit2 error $0 ("Reloading global configuration and overlay failed!" . \
+ " Syntax error or missing overlay\?") false;
+ }
+ }
+
:if ($ExpectedConfigVersionBefore != $ExpectedConfigVersion) do={
:global GlobalConfigChanges;
:global GlobalConfigMigration;