Alexandre
2024-10-10 20:13:15 +02:00
committed by GitHub
parent 35a4ccad91
commit 7ac13b73f6

View File

@@ -12,16 +12,16 @@ if [ ! -d /config ]; then
fi
# Define slug
slug="${HOSTNAME}"
slug="${HOSTNAME//-/_}"
# Check type of config folder
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
# New config location
CONFIGLOCATION="/config"
CONFIGFILEBROWSER="/addon_configs/$slug/${HOSTNAME#*-}.sh"
CONFIGFILEBROWSER="/addon_configs/$slug/${HOSTNAME#*_}.sh"
else
# Legacy config location
slug="${HOSTNAME#*-}"
slug="${HOSTNAME#*_}"
CONFIGLOCATION="/config/addons_autoscripts"
CONFIGFILEBROWSER="/homeassistant/addons_autoscripts/${slug}.sh"
fi