diff --git a/.templates/01-config_yaml.sh b/.templates/01-config_yaml.sh index 8027e74c8..40138ccc1 100644 --- a/.templates/01-config_yaml.sh +++ b/.templates/01-config_yaml.sh @@ -39,6 +39,16 @@ else fi +# Permissions +mkdir -p "$(dirname "${CONFIGSOURCE}")" +chmod -R 755 "$(dirname "${CONFIGSOURCE}")" + +#################### +# LOAD CONFIG.YAML # +#################### + +bashio::log.info "Load environment variables from $CONFIGSOURCE if existing" + # Check if config file is there, or create one from template if [ ! -f "$CONFIGSOURCE" ]; then echo "... no config file, creating one from template. Please customize the file in $CONFIGSOURCE before restarting." @@ -55,15 +65,6 @@ if [ ! -f "$CONFIGSOURCE" ]; then fi fi -# Permissions -chmod -R 755 "$(dirname "${CONFIGSOURCE}")" - -#################### -# LOAD CONFIG.YAML # -#################### - -bashio::log.info "Load environment variables from $CONFIGSOURCE if existing" - # Check if there are lines to read cp "$CONFIGSOURCE" /tempenv sed -i '/^#/d' /tempenv