mirror of
https://github.com/hassio-addons/addon-traccar.git
synced 2025-05-04 19:11:31 +00:00
🚑 Make sure the database isn't locked on startup
This commit is contained in:
parent
38753bab3c
commit
d1f780f503
1 changed files with 18 additions and 0 deletions
|
@ -3,6 +3,24 @@
|
|||
# Home Assistant Community Add-on: Traccar
|
||||
# Ensures the user configuration file is present
|
||||
# ==============================================================================
|
||||
declare host
|
||||
declare password
|
||||
declare port
|
||||
declare username
|
||||
|
||||
if ! bashio::fs.file_exists "/config/traccar.xml"; then
|
||||
cp /etc/traccar/traccar.xml /config/traccar.xml
|
||||
else
|
||||
# Existing installation
|
||||
if bashio::services.available "mysql"; then
|
||||
# Make sure the database isn't locked
|
||||
host=$(bashio::services "mysql" "host")
|
||||
password=$(bashio::services "mysql" "password")
|
||||
port=$(bashio::services "mysql" "port")
|
||||
username=$(bashio::services "mysql" "username")
|
||||
|
||||
echo "UPDATE DATABASECHANGELOGLOCK SET locked=0;" \
|
||||
| mysql -h "${host}" -P "${port}" -u "${username}" -p"${password}" \
|
||||
traccar
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue