From 4eabb944dfb5e868b305b546a4bddceb29ce3fbc Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 1 Mar 2020 17:39:20 +0100 Subject: [PATCH] :ambulance: Skip MySQL container init when database is override by user --- traccar/rootfs/etc/cont-init.d/mysql.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/traccar/rootfs/etc/cont-init.d/mysql.sh b/traccar/rootfs/etc/cont-init.d/mysql.sh index 3bbf843..35dbc06 100644 --- a/traccar/rootfs/etc/cont-init.d/mysql.sh +++ b/traccar/rootfs/etc/cont-init.d/mysql.sh @@ -10,6 +10,14 @@ declare port declare username declare url +if bashio::fs.file_exists "/config/traccar.xml"; then + if xmlstarlet sel -t -v "/properties/entry[@key='database.driver']" \ + "/config/traccar.xml" >/dev/null 2>&1; + then + exit 0 + fi +fi + if bashio::services.available "mysql"; then host=$(bashio::services "mysql" "host") password=$(bashio::services "mysql" "password")