Update 20-folders.sh

This commit is contained in:
Alexandre
2022-02-20 11:38:19 +01:00
committed by GitHub
parent e12b45a9a4
commit 9bef2ab7ea

View File

@@ -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