Compare commits

...

4 commits

Author SHA1 Message Date
Christian Hesse
8878449b0b global-functions: support modules (or snippets) in global-functions.d/ 2026-01-05 11:37:58 +01:00
Christian Hesse
8fa17d4b3b check-health: fix regex to load plugins 2026-01-05 11:11:52 +01:00
Christian Hesse
8528ca376c global-config: support loading custom config snippets
This may be interesting for custom scripts which can drop their own
default global configuration.
2026-01-05 11:11:52 +01:00
Christian Hesse
4af18ced9e global-config: fix regex to load overlay snippets 2026-01-05 11:11:52 +01:00
3 changed files with 5 additions and 4 deletions

View file

@ -74,7 +74,7 @@
:set CheckHealthRAMUtilizationNotified false;
}
:local Plugins [ /system/script/find where name~"^check-health.d/." ];
:local Plugins [ /system/script/find where name~"^check-health\\.d/." ];
:if ([ :len $Plugins ] = 0) do={
$LogPrint debug $ScriptName ("No plugins installed.");
:set ExitOK true;

View file

@ -275,8 +275,9 @@
# /_()_\ Things *will* break!
#
# load custom settings from overlay and snippets
:foreach Script in=([ /system/script/find where name="global-config-overlay" ], \
[ /system/script/find where name~"^global-config-overlay.d/" ]) do={
:foreach Script in=([ /system/script/find where name~"^global-config\\.d/." ], \
[ /system/script/find where name="global-config-overlay" ], \
[ /system/script/find where name~"^global-config-overlay\\.d/." ]) do={
:onerror Err {
/system/script/run $Script;
} do={

View file

@ -1900,7 +1900,7 @@
}
# load modules
:foreach Script in=[ /system/script/find where name ~ "^mod/." ] do={
:foreach Script in=[ /system/script/find where name ~ "^(global-functions\\.d|mod)/." ] do={
:local ScriptVal [ /system/script/get $Script ];
:if ([ $ValidateSyntax ($ScriptVal->"source") ] = true) do={
:onerror Err {