mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Add default value if config location not correct
https://github.com/alexbelgium/hassio-addons/issues/223
This commit is contained in:
@@ -10,15 +10,17 @@
|
|||||||
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
||||||
|
|
||||||
# Check if config is located in an acceptable location
|
# Check if config is located in an acceptable location
|
||||||
#for location in "/share" "/config" "/data"
|
LOCATIONOK=""
|
||||||
#if [[ "$CONFIGSOURCE" == "$location"* ]]; then
|
for location in "/share" "/config" "/data"; do
|
||||||
#LOCATIONOK=true
|
if [[ "$CONFIGSOURCE" == "$location"* ]]; then
|
||||||
#fi
|
LOCATIONOK=true
|
||||||
#done
|
fi
|
||||||
#if [ ! "$LOCATIONOK" = "true" ]; then
|
done
|
||||||
#CONFIGSOURCE=
|
|
||||||
#bashio::log.fatal "Your CONFIG_LOCATION values can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $CONFIGSOURCE"
|
if [ -z "$LOCATIONOK" ]; then
|
||||||
#fi
|
CONFIGSOURCE=/config/addons_config/${HOSTNAME#*-}
|
||||||
|
bashio::log.fatal "Your CONFIG_LOCATION values can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $CONFIGSOURCE"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if config file is there, or create one from template
|
# Check if config file is there, or create one from template
|
||||||
if [ -f "$CONFIGSOURCE" ]; then
|
if [ -f "$CONFIGSOURCE" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user