This commit is contained in:
Felipe Santos 2025-04-21 15:24:48 -03:00 committed by GitHub
commit c1758be270
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -22,10 +22,11 @@ ports_description:
map: map:
- addons - addons
- backup - backup
- config:rw - addon_config:rw
- share - share
- ssl - ssl
- media - media
- homeassistant_config:rw # to enable migration to addon_config
hassio_api: true hassio_api: true
auth_api: true auth_api: true
docker_api: true docker_api: true

View file

@ -6,6 +6,14 @@
declare protocol declare protocol
bashio::require.unprotected bashio::require.unprotected
# Migrate add-on data from the Home Assistant config directory,
# to the add-on configuration directory.
if ! bashio::fs.file_exists '/config/glances/glances.conf' \
&& bashio::fs.file_exists '/homeassistant/glances/glances.conf'; then
mv /homeassistant/glances /config/ \
|| bashio::exit.nok "Failed to migrate Glances configuration out of Home Assistant config directory"
fi
# Ensure the configuration exists # Ensure the configuration exists
if bashio::fs.file_exists '/config/glances/glances.conf'; then if bashio::fs.file_exists '/config/glances/glances.conf'; then
cp -f /config/glances/glances.conf /etc/glances.conf cp -f /config/glances/glances.conf /etc/glances.conf