diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-10-27 10:27:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 10:27:03 -0700 |
commit | 9643a56ec4102dbb9be06566ebe899c5b623fe54 (patch) | |
tree | 875f479d1a1955cfdff9ab7cce624b869c483bdf | |
parent | 3f7bcee046d6a023474cdc511ef0fa3c8118b4aa (diff) | |
parent | 07cb0b443700041da16510f3594cebfc69ce9051 (diff) | |
download | trackermap-server-9643a56ec4102dbb9be06566ebe899c5b623fe54.tar.gz trackermap-server-9643a56ec4102dbb9be06566ebe899c5b623fe54.tar.bz2 trackermap-server-9643a56ec4102dbb9be06566ebe899c5b623fe54.zip |
Merge pull request #4592 from mivtdole/save_config
Preserve existing traccar.xml on update
-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 |