From a23b0adc89c1739728fea6ae5f39deea932a4e96 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:03:27 +0100 Subject: [PATCH] Update 99-run.sh --- enedisgateway2mqtt/rootfs/scripts/99-run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/enedisgateway2mqtt/rootfs/scripts/99-run.sh b/enedisgateway2mqtt/rootfs/scripts/99-run.sh index 0bc4d0308..ef29c0509 100644 --- a/enedisgateway2mqtt/rootfs/scripts/99-run.sh +++ b/enedisgateway2mqtt/rootfs/scripts/99-run.sh @@ -5,8 +5,10 @@ ############################ if bashio::config.true "test"; then + # Where is the config CONFIGSOURCE="/config/enedisgateway2mqtt/config.yaml" - # Check if config file is there, or create template + + # Check if config file is there, or create one from template if [ -f $CONFIGSOURCE ]; then echo "Using config file found in $CONFIGSOURCE" else @@ -17,7 +19,9 @@ if bashio::config.true "test"; then # Placing template in config mkdir -p "$(dirname "${CONFIGSOURCE}")" cp config.yaml "$(dirname "${CONFIGSOURCE}")" + # Need to restart bashio::log.fatal "Config file not found, creating a new one. Please customize the file in $CONFIGSOURCE before restarting." + bashio::exit.nok fi # Check if yaml is valid