mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 05:14:04 +02:00
Update 99-run.sh
This commit is contained in:
@@ -7,7 +7,7 @@ EXIT_CODE=0
|
|||||||
|
|
||||||
# Where is the config
|
# Where is the config
|
||||||
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
||||||
DATABASESOURCE=$(dirname "${CONFIGSOURCE}")/database.sqlite
|
DATABASESOURCE="$(dirname "${CONFIGSOURCE}")/enedisgateway.db"
|
||||||
|
|
||||||
# Make sure folder exist
|
# Make sure folder exist
|
||||||
mkdir -p "$(dirname "${CONFIGSOURCE}")"
|
mkdir -p "$(dirname "${CONFIGSOURCE}")"
|
||||||
@@ -43,21 +43,21 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Use existing database if present
|
# Use existing database if present
|
||||||
#if [ -e /data/database.sqlite ]; then
|
if [ -e /data/enedisgateway.db ]; then
|
||||||
#[ ! -f $DATABASESOURCE ] && mv /data/database.sqlite $(dirname "${DATABASESOURCE}") \
|
[ ! -f $DATABASESOURCE ] && mv /data/enedisgateway.db $(dirname "${DATABASESOURCE}") \
|
||||||
#|| mv /data/database.sqlite /data/database2.sqlite
|
|| mv /data/enedisgateway.db /data/enedisgateway2.db
|
||||||
#fi
|
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
|
||||||
# ln -s ${DATABASESOURCE} /data
|
ln -s ${DATABASESOURCE} /data
|
||||||
# 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
|
||||||
# touch ${DATABASESOURCE}
|
touch ${DATABASESOURCE}
|
||||||
# ln -s $DATABASESOURCE /data
|
ln -s $DATABASESOURCE /data
|
||||||
# rm $DATABASESOURCE
|
rm $DATABASESOURCE
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Launch App #
|
# Launch App #
|
||||||
|
|||||||
Reference in New Issue
Block a user