aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions7
1 files changed, 6 insertions, 1 deletions
diff --git a/global-functions b/global-functions
index a86c1ea..89234f9 100644
--- a/global-functions
+++ b/global-functions
@@ -1271,7 +1271,12 @@
# load modules
:foreach Script in=[ / system script find where name ~ "^mod/." ] do={
- / system script run $Script;
+ :local ScriptVal [ / system script get $Script ];
+ :if ([ $ValidateSyntax ($ScriptVal->"source") ] = true) do={
+ / system script run $Script;
+ } else={
+ $LogPrintExit2 error $0 ("Module '" . $ScriptVal->"name" . "' failed syntax validation, skipping.") false;
+ }
}
# check for required RouterOS version