mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
Prevent copy of symlink on itself
https://github.com/alexbelgium/hassio-addons/issues/600
This commit is contained in:
@@ -30,8 +30,7 @@ if [ -f /data/enedisgateway.db.migrate ]; then
|
||||
fi
|
||||
|
||||
# If migration was performed, save file in config folder
|
||||
if [ -f /data/cache.db ]; then
|
||||
if [ -f "$DATABASESOURCE" ]; then cp "$DATABASESOURCE" "$DATABASESOURCE".bak2; fi
|
||||
if [ -f /data/cache.db ] && [ ! -f "$DATABASESOURCE" ]; then
|
||||
if [ -f "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db ]; then mv "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db "$(dirname "${CONFIGSOURCE}")"/enedisgateway.db.bak2; fi
|
||||
mv /data/cache.db "$(dirname "${CONFIGSOURCE}")"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user