Update 99-run.sh

This commit is contained in:
Alexandre
2021-11-18 22:21:54 +01:00
committed by GitHub
parent d4ca385334
commit 8085380203

View File

@@ -43,16 +43,13 @@ else
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting." bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi fi
# Check absence of database file # Remove previous link or file
if [ -f /data/enedisgateway.db ] && [ ! -L /data/enedisgateway.db ]; then [ -f /data/enedisgateway.db ] && rm /data/enedisgateway.db
bashio::log.warning "A current database was found in /data, it is backuped to ${DATABASESOURCE}.bak"
mv /data/enedisgateway.db $DATABASESOURCE.bak
fi
# Check if database is here or create symlink # Check if database is here or create symlink
if [ -f $DATABASESOURCE ]; then if [ -f $DATABASESOURCE ]; then
# Create symlink if not existing yet # Create symlink if not existing yet
[ ! -L /data/enedisgateway.db ] && ln -sf ${DATABASESOURCE} /data && echo "creating symlink" ln -sf ${DATABASESOURCE} /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE" bashio::log.info "Using database file found in $DATABASESOURCE"
else else
# Create symlink for addon to create database # Create symlink for addon to create database