mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-28 02:06:04 +02:00
Prevent error symlinks
This commit is contained in:
@@ -21,7 +21,7 @@ fi
|
|||||||
# Check if config file is there, or create one from template
|
# Check if config file is there, or create one from template
|
||||||
if [ -f $CONFIGSOURCE ]; then
|
if [ -f $CONFIGSOURCE ]; then
|
||||||
# Create symlink if not existing yet
|
# Create symlink if not existing yet
|
||||||
[ ! -L /data/config.yaml ] && ln -s $CONFIGSOURCE /data
|
[ ! -L /data/config.yaml ] && ln -sf $CONFIGSOURCE /data
|
||||||
bashio::log.info "Using config file found in $CONFIGSOURCE"
|
bashio::log.info "Using config file found in $CONFIGSOURCE"
|
||||||
|
|
||||||
# Check if yaml is valid
|
# Check if yaml is valid
|
||||||
@@ -37,7 +37,7 @@ if [ -f $CONFIGSOURCE ]; then
|
|||||||
else
|
else
|
||||||
# Create symlink for addon to create config
|
# Create symlink for addon to create config
|
||||||
touch ${CONFIGSOURCE}
|
touch ${CONFIGSOURCE}
|
||||||
ln -s $CONFIGSOURCE /data
|
ln -sf $CONFIGSOURCE /data
|
||||||
rm $CONFIGSOURCE
|
rm $CONFIGSOURCE
|
||||||
# Need to restart
|
# Need to restart
|
||||||
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."
|
||||||
@@ -52,12 +52,12 @@ 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 -s ${DATABASESOURCE} /data
|
[ ! -L /data/enedisgateway.db ] && ln -sf ${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 -sf $DATABASESOURCE /data
|
||||||
rm $DATABASESOURCE
|
rm $DATABASESOURCE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user