mirror of
https://github.com/traccar/traccar.git
synced 2025-01-07 03:07:01 +08:00
Preserve existing traccar.xml on update
This commit is contained in:
parent
c686a4f045
commit
07cb0b4437
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user