From 0ed29ace929fdd9862832e76058cd1ffb0d7cbf9 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Sat, 15 Aug 2026 19:54:12 +0200 Subject: [PATCH] avoid leaving persisted web dirs in core tree --- rootfs/etc/cont-init.d/03-config.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rootfs/etc/cont-init.d/03-config.sh b/rootfs/etc/cont-init.d/03-config.sh index 7371f53..8db39eb 100644 --- a/rootfs/etc/cont-init.d/03-config.sh +++ b/rootfs/etc/cont-init.d/03-config.sh @@ -38,10 +38,13 @@ persist_web_dir() { for web_entry in "$web_path"/* "$web_path"/.[!.]*; do [ -e "$web_entry" ] || continue entry_name="$(basename "$web_entry")" - [ -e "${data_path}/${entry_name}" ] || cp -a "$web_entry" "$data_path/" + if [ ! -e "${data_path}/${entry_name}" ]; then + cp -a "$web_entry" "$data_path/" || exit 1 + fi done - mv "$web_path" "${web_path}.dist" + rm -rf "$web_path" fi + rm -rf "${web_path}.dist" if [ -e "$web_path" ] && [ ! -L "$web_path" ]; then echo >&2 "ERROR: Failed to replace ${web_path} with ${data_path} symlink" exit 1