From 1c6ce129c5589916a149399e55b2379955f767c1 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 28 Dec 2024 16:50:19 +0100 Subject: [PATCH] Update 99-run.sh --- grampsweb/rootfs/etc/cont-init.d/99-run.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/grampsweb/rootfs/etc/cont-init.d/99-run.sh b/grampsweb/rootfs/etc/cont-init.d/99-run.sh index 1aef9529d..876941fc3 100755 --- a/grampsweb/rootfs/etc/cont-init.d/99-run.sh +++ b/grampsweb/rootfs/etc/cont-init.d/99-run.sh @@ -5,9 +5,20 @@ set -e ################# # Set structure # ################# -cp -rf /app/* /config/ -rm -r /app -ln -s /config /app +for folders in config users indexdir database secret media cache thumbnail_cache grampsdb; do + mkdir -p /config/"$folders" + if [ -d /app/"$folders" ] && [ "$(ls -A /app/"$folders")" ]; then + cp -rf /app/"$folders"/* /config/"$folders" + fi + rm -rf /app/"$folders" + ln -sf /config/"$folders" /app/"$folders" +done + +if [ -d /root/.gramps/grampsdb ] && [ "$(ls -A /root/.gramps/grampsdb)" ]; then + cp -rf /root/.gramps/grampsdb/* /config/grampsdb + rm -rf /root/.gramps/grampsdb + ln -sf /config/grampsdb /root/.gramps/grampsdb +fi ##################### # Create secret key #