From 4635e8aafbf4fc9580451982040380794b66d8a1 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 18 Nov 2021 09:04:53 +0100 Subject: [PATCH] Update 99-run.sh --- enedisgateway2mqtt/rootfs/scripts/99-run.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/enedisgateway2mqtt/rootfs/scripts/99-run.sh b/enedisgateway2mqtt/rootfs/scripts/99-run.sh index 056d38a8c..e0d596803 100644 --- a/enedisgateway2mqtt/rootfs/scripts/99-run.sh +++ b/enedisgateway2mqtt/rootfs/scripts/99-run.sh @@ -20,7 +20,8 @@ fi # Check if config file is there, or create one from template if [ -f $CONFIGSOURCE ]; then - ln -s $CONFIGSOURCE /data + # Create symlink kg not existing yet + [ ! -f /data/config.yaml ] && ln -s $CONFIGSOURCE /data bashio::log.info "Using config file found in $CONFIGSOURCE" # Check if yaml is valid @@ -50,7 +51,8 @@ fi # Check if database is here or create symlink if [ -f $DATABASESOURCE ]; then - ln -s ${DATABASESOURCE} /data + # Create symlink kg not existing yet + [ ! -f /data/enedisgateway.db ] && ln -s ${DATABASESOURCE} /data bashio::log.info "Using database file found in $DATABASESOURCE" else # Create symlink for addon to create database