From cd4b11fb56dfafbce09c8a398aef917d38596b6c Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 15 Nov 2021 13:36:15 +0100 Subject: [PATCH] Update 99-run.sh --- enedisgateway2mqtt/rootfs/scripts/99-run.sh | 33 +++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/enedisgateway2mqtt/rootfs/scripts/99-run.sh b/enedisgateway2mqtt/rootfs/scripts/99-run.sh index ffd8310a6..626884d1e 100644 --- a/enedisgateway2mqtt/rootfs/scripts/99-run.sh +++ b/enedisgateway2mqtt/rootfs/scripts/99-run.sh @@ -1,5 +1,33 @@ #!/usr/bin/env bashio +############################ +# Check if config is there # +############################ + +#CONFIGSOURCE="/config/enedisgateway2mqtt/config.yaml" + +# Check if config file is there, or create template +#if [ -f $CONFIGSOURCE ]; then +# echo "Using config file found in $CONFIGSOURCE" +#else +# bashio::log.fatal "Config file not found, creating a new one. Please customize the file in $CONFIGSOURCE" +# mkdir -p "$(dirname "${CONFIGSOURCE}")" +# cp /template/config.yaml "$(dirname "${CONFIGSOURCE}")" +# bashio::exit.nok +#fi +# +# Check if yaml is valid +#if [ yamllint $CONFIGSOURCE ]; then +# echo "Config file is a valid yaml" +#else +# bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE" +# bashio::exit.nok +#fi + + + + + ################# # Create config # ################# @@ -67,11 +95,6 @@ for word in $(cat $CONFIGSOURCE); do fi done -# Force asset token string -export ACCESS_TOKEN=$(bashio::config "ACCESS_TOKEN") -export PDL=$(bashio::config "PDL") -export MQTT_HOST=$(bashio::config "MQTT_HOST") - ############## # Launch App # ##############