From 1a4acea55df49336a3cb3b3129f2343a10def5af Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 21 Apr 2023 12:38:23 +0200 Subject: [PATCH] Update 20-folders.sh --- immich/rootfs/etc/cont-init.d/20-folders.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/immich/rootfs/etc/cont-init.d/20-folders.sh b/immich/rootfs/etc/cont-init.d/20-folders.sh index aec822062..88caa92b9 100755 --- a/immich/rootfs/etc/cont-init.d/20-folders.sh +++ b/immich/rootfs/etc/cont-init.d/20-folders.sh @@ -10,6 +10,10 @@ PGID="$(bashio::config 'PGID')" bashio::log.info "Setting data location" DATA_LOCATION="$(bashio::config 'data_location')" +export IMMICH_MEDIA_LOCATION="$DATA_LOCATION" +if [ -d /var/run/s6/container_environment ]; then + printf "%s" "$DATA_LOCATION" > /var/run/s6/container_environment/IMMICH_MEDIA_LOCATION +fi echo "... check $DATA_LOCATION folder exists" mkdir -p "$DATA_LOCATION" @@ -20,6 +24,6 @@ chown -R "$PUID":"$PGID" "$DATA_LOCATION" echo "... correcting official script" # shellcheck disable=SC2013 for file in $(grep -sril '/photos' /etc); do sed -i "s|/photos|$DATA_LOCATION|g" "$file"; done -rm -r /photos +if [-f / photos ]; then rm -r /photos; fi ln -sf "$DATA_LOCATION" /photos chown -R "$PUID":"$PGID" /photos