mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-29 18:56:04 +02:00
Update 20-migration_config.sh
This commit is contained in:
@@ -3,12 +3,19 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
slug=fireflyiii_data_importer
|
slug=fireflyiii_data_importer
|
||||||
|
|
||||||
|
if [[ "$(bashio::config "CONFIG_LOCATION")" == *"/addons_config/fireflyiii_data_importer"* ]]; then
|
||||||
|
bashio::log.warning "Reset CONFIG_LOCATION to /config"
|
||||||
|
bashio::addon.option "CONFIG_LOCATION" "/config"
|
||||||
|
bashio::addon.restart
|
||||||
|
fi
|
||||||
|
|
||||||
CONFIGSOURCE="$(bashio::config "CONFIG_LOCATION")"
|
CONFIGSOURCE="$(bashio::config "CONFIG_LOCATION")"
|
||||||
|
|
||||||
if [ -d "/homeassistant/addons_config/$slug" ]; then
|
if [ -d "/homeassistant/addons_config/$slug" ] && [ ! -f "/homeassistant/addons_config/$slug/migrated" ]; then
|
||||||
echo "Migrating /homeassistant/addons_config/$slug"
|
echo "Migrating /homeassistant/addons_config/$slug"
|
||||||
mv /homeassistant/addons_config/"$slug"/* "$CONFIGSOURCE"/ || true
|
mv /homeassistant/addons_config/"$slug"/* "$CONFIGSOURCE"/
|
||||||
rm -r /homeassistant/addons_config/"$slug"
|
touch /homeassistant/addons_config/$slug/migrated
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create directory
|
# Create directory
|
||||||
|
|||||||
Reference in New Issue
Block a user