global-config: support loading snippets

This adds support for loading snippets, which need a name starting with
"global-config-overlay.d/". This allows to split off configuration if
desired.
This commit is contained in:
Christian Hesse 2024-03-08 09:33:17 +01:00
parent e39e8a0083
commit a7cb3e520a
4 changed files with 17 additions and 1 deletions

View file

@ -250,3 +250,13 @@
} on-error={
:log error ("Loading configuration from overlay failed!");
}
# configuration overlay snippets
:foreach Script in=[ /system/script/find where name ~ "^global-config-overlay.d/" ] do={
:do {
/system/script/run $Script;
} on-error={
:log error ("Loading configuration from overlay snippet " . \
[ /system/script/get $Script name ] . " failed!");
}
}