mirror of
https://github.com/hassio-addons/addon-traccar.git
synced 2025-05-04 19:11:31 +00:00
Migrate Traccar config out of Home Assistant config folder
This commit is contained in:
parent
1a6c19c124
commit
c18e0e6da3
3 changed files with 11 additions and 2 deletions
|
@ -106,7 +106,7 @@ been done to reduce the number of open ports the add-on would create.
|
||||||
|
|
||||||
By default, only the OsmAnd protocol (used by the Traccar Apps) and the API
|
By default, only the OsmAnd protocol (used by the Traccar Apps) and the API
|
||||||
are enabled. If you want more protocols, you can do so, by adding entries
|
are enabled. If you want more protocols, you can do so, by adding entries
|
||||||
to your `/config/traccar.xml` file.
|
to your `traccar.xml` file in the add-on configuration folder.
|
||||||
|
|
||||||
A list if all entries can be found here:
|
A list if all entries can be found here:
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@ ports:
|
||||||
ports_description:
|
ports_description:
|
||||||
80/tcp: Web interface
|
80/tcp: Web interface
|
||||||
map:
|
map:
|
||||||
- config:rw
|
- addon_config:rw
|
||||||
|
- homeassistant_config:rw
|
||||||
- ssl
|
- ssl
|
||||||
services:
|
services:
|
||||||
- mysql:want
|
- mysql:want
|
||||||
|
|
|
@ -8,6 +8,14 @@ declare password
|
||||||
declare port
|
declare port
|
||||||
declare username
|
declare username
|
||||||
|
|
||||||
|
# Migrate add-on data from the Home Assistant config folder,
|
||||||
|
# to the add-on configuration folder.
|
||||||
|
if ! bashio::fs.directory_exists '/config/traccar.xml' \
|
||||||
|
&& bashio::fs.file_exists '/homeassistant/traccar.xml'; then
|
||||||
|
mv /homeassistant/traccar.xml /config/traccar.xml \
|
||||||
|
|| bashio::exit.nok "Failed to migrate Traccar configuration"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! bashio::fs.file_exists "/config/traccar.xml"; then
|
if ! bashio::fs.file_exists "/config/traccar.xml"; then
|
||||||
cp /etc/traccar/traccar.xml /config/traccar.xml
|
cp /etc/traccar/traccar.xml /config/traccar.xml
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue