From 07cb0b443700041da16510f3594cebfc69ce9051 Mon Sep 17 00:00:00 2001 From: Michel Verbraak Date: Thu, 22 Oct 2020 09:44:30 +0200 Subject: Preserve existing traccar.xml on update --- setup/setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup/setup.sh b/setup/setup.sh index 7443c3b4e..1b07990ae 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -1,9 +1,21 @@ #!/bin/sh +PRESERVECONFIG=0 +if [ -f /opt/traccar/conf/traccar.xml ] +then + cp /opt/traccar/conf/traccar.xml /opt/traccar/conf/traccar.xml.saved + PRESERVECONFIG=1 +fi + mkdir -p /opt/traccar cp -r * /opt/traccar chmod -R go+rX /opt/traccar +if [ ${PRESERVECONFIG} -eq 1 ] && [ -f /opt/traccar/conf/traccar.xml.saved ] +then + mv -f /opt/traccar/conf/traccar.xml.saved /opt/traccar/conf/traccar.xml +fi + mv /opt/traccar/traccar.service /etc/systemd/system chmod 664 /etc/systemd/system/traccar.service -- cgit v1.2.3