From 9bef2ab7eaaef181bcfe3b32dd35322fd0d6bfd8 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 20 Feb 2022 11:38:19 +0100 Subject: [PATCH] Update 20-folders.sh --- jellyfin/rootfs/etc/cont-init.d/20-folders.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/jellyfin/rootfs/etc/cont-init.d/20-folders.sh b/jellyfin/rootfs/etc/cont-init.d/20-folders.sh index 064f6f881..a61296c99 100644 --- a/jellyfin/rootfs/etc/cont-init.d/20-folders.sh +++ b/jellyfin/rootfs/etc/cont-init.d/20-folders.sh @@ -3,6 +3,21 @@ LOCATION=$(bashio::config 'data_location') +# Check if config is located in an acceptable location +LOCATIONOK="" +for location in "/share" "/config" "/data" "/mnt"; do + if [[ "$LOCATION" == "$location"* ]]; then + LOCATIONOK=true + fi +done + +if [ -z "$LOCATIONOK" ]; then + LOCATION=/config/addons_config/${HOSTNAME#*-} + bashio::log.fatal "Your data_location value can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $LOCATION" +fi + +# Set folders + if [ ! -d /jellyfin ]; then echo "Creating /jellyfin" mkdir -p /jellyfin