harden runtime config and docs

This commit is contained in:
root
2026-06-27 20:58:07 +00:00
parent c148c1b36b
commit 991a0f62b4
13 changed files with 147 additions and 62 deletions
+15 -2
View File
@@ -19,10 +19,23 @@ CONFIG_DEST="/etc/uce/settings.cfg"
action="${1:-setup}"
render_runtime_file() {
local source="$1"
local destination="$2"
local mode="$3"
local tmp
tmp="$(mktemp)"
trap 'rm -f "$tmp"' RETURN
sed "s#/Code/uce.openfu.com/uce#$REPO_ROOT#g" "$source" > "$tmp"
install -D -m "$mode" "$tmp" "$destination"
rm -f "$tmp"
trap - RETURN
}
install_unit() {
install -D -m 0644 "$UNIT_SOURCE" "$UNIT_DEST"
render_runtime_file "$UNIT_SOURCE" "$UNIT_DEST" 0644
if [[ ! -f "$CONFIG_DEST" ]]; then
install -D -m 0644 "$CONFIG_SOURCE" "$CONFIG_DEST"
render_runtime_file "$CONFIG_SOURCE" "$CONFIG_DEST" 0644
fi
systemctl daemon-reload
}