Update 00-folders.sh

This commit is contained in:
Alexandre
2022-03-22 11:14:51 +01:00
committed by GitHub
parent 4e8a790932
commit 30d44e2444

View File

@@ -1,15 +1,14 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
CONFIGLOCATION=$(bashio::config "CONFIG_LOCATION")
# Config location
CONFIGLOCATION="$(bashio::config 'CONFIG_LOCATION')"
# Text
bashio::log.info "Setting config location to $CONFIGLOCATION"
if [ ! -d "$CONFIGLOCATION" ]; then
CONFIGLOCATION="$(dirname "$CONFIGLOCATION")"
fi
# Adapt files
sed -i "s|/data/config|$CONFIGLOCATION|g" /etc/cont-init.d/*
sed -i "s|/data/config|$CONFIGLOCATION|g" /defaults/*
# Create directory
mkdir -p "$CONFIGLOCATION"/config