aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions17
1 files changed, 11 insertions, 6 deletions
diff --git a/global-functions b/global-functions
index 9f5be02..cf4ad7a 100644
--- a/global-functions
+++ b/global-functions
@@ -709,6 +709,7 @@
}
:local ExpectedConfigVersionBefore $ExpectedConfigVersion;
+ :local ReloadGlobalFunctions false;
:local ScriptInstallUpdateBefore [ :tostr $ScriptInstallUpdate ];
:foreach Script in=[ / system script find where source~"^#!rsc( by RouterOS)\?\n" ] do={
@@ -768,12 +769,7 @@
}
}
:if ($ScriptVal->"name" ~ "^global-functions(\$|\\.d/.)") do={
- $LogPrintExit2 info $0 ("Reloading global functions.") false;
- :do {
- / system script run global-functions;
- } on-error={
- $LogPrintExit2 error $0 ("Reloading global functions failed!") false;
- }
+ :set ReloadGlobalFunctions true;
}
} else={
$LogPrintExit2 warning $0 ("Syntax validation for script " . $ScriptVal->"name" . \
@@ -791,6 +787,15 @@
}
}
+ :if ($ReloadGlobalFunctions = true) do={
+ $LogPrintExit2 info $0 ("Reloading global functions.") false;
+ :do {
+ / system script run global-functions;
+ } on-error={
+ $LogPrintExit2 error $0 ("Reloading global functions failed!") false;
+ }
+ }
+
:if ($ExpectedConfigVersionBefore != $ExpectedConfigVersion) do={
:global GlobalConfigChanges;
:global GlobalConfigMigration;