diff options
author | Michel Verbraak <michel.verbraak@politie.nl> | 2020-10-22 09:44:30 +0200 |
---|---|---|
committer | Michel Verbraak <michel.verbraak@politie.nl> | 2020-10-27 08:37:42 +0100 |
commit | 07cb0b443700041da16510f3594cebfc69ce9051 (patch) | |
tree | 104a9ee8416ea92005f79941fb48b7af52680dc6 /setup/setup.sh | |
parent | c686a4f045f15944940e131ccfb2fa6a1e0a5e7c (diff) | |
download | trackermap-server-07cb0b443700041da16510f3594cebfc69ce9051.tar.gz trackermap-server-07cb0b443700041da16510f3594cebfc69ce9051.tar.bz2 trackermap-server-07cb0b443700041da16510f3594cebfc69ce9051.zip |
Preserve existing traccar.xml on update
Diffstat (limited to 'setup/setup.sh')
-rwxr-xr-x | setup/setup.sh | 12 |
1 files changed, 12 insertions, 0 deletions
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 |