diff options
author | Christian Hesse <mail@eworm.de> | 2021-06-02 23:51:11 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-06-08 21:07:24 +0200 |
commit | f9a2afdedafc9639bf658335218bd00274364827 (patch) | |
tree | 798f50fc75442cf47f2b3f7e3b74cf583dcf527c | |
parent | 2315d6bc59e6d2294fadb5f0ab8d712f55793db2 (diff) |
global-functions: $ScriptInstallUpdate: reload configuration later
-rw-r--r-- | global-functions | 19 |
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; |