mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: validate syntax of modules
This commit is contained in:
parent
9bc2123ee5
commit
7c8e230521
1 changed files with 6 additions and 1 deletions
|
@ -1267,7 +1267,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
|
||||
|
|
Loading…
Reference in a new issue