mirror of
https://github.com/hassio-addons/addon-glances.git
synced 2025-05-04 11:01:25 +00:00
Migrate add-on data out of Home Assitant config dir
This commit is contained in:
parent
6c6694588e
commit
1a11daee15
2 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -6,6 +6,15 @@
|
||||||
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.conf' \
|
||||||
|
&& bashio::fs.file_exists '/homeassistant/glances/glances.conf'; then
|
||||||
|
shopt -s dotglob
|
||||||
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue