mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: support loading modules
If script's name starts with "global-functions.d/" it is handled as module: * loaded at startup * triggers reload on update
This commit is contained in:
parent
a1c8716a95
commit
57b0f1b2dd
|
@ -767,7 +767,7 @@
|
||||||
" Syntax error or missing overlay\?") false;
|
" Syntax error or missing overlay\?") false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:if ($ScriptVal->"name" = "global-functions") do={
|
:if ($ScriptVal->"name" ~ "^global-functions(\$|\\.d/.)") do={
|
||||||
$LogPrintExit2 info $0 ("Reloading global functions.") false;
|
$LogPrintExit2 info $0 ("Reloading global functions.") false;
|
||||||
:do {
|
:do {
|
||||||
/ system script run global-functions;
|
/ system script run global-functions;
|
||||||
|
@ -1261,6 +1261,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# load modules
|
||||||
|
:foreach Script in=[ / system script find where name ~ "^global-functions\\.d/." ] do={
|
||||||
|
/ system script run $Script;
|
||||||
|
}
|
||||||
|
|
||||||
# check for required RouterOS version
|
# check for required RouterOS version
|
||||||
$RequiredRouterOS "global-functions" "6.47";
|
$RequiredRouterOS "global-functions" "6.47";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue