aboutsummaryrefslogtreecommitdiff
path: root/setup/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'setup/setup.sh')
-rwxr-xr-xsetup/setup.sh12
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