aboutsummaryrefslogtreecommitdiff
path: root/setup/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'setup/setup.sh')
-rwxr-xr-xsetup/setup.sh28
1 files changed, 12 insertions, 16 deletions
diff --git a/setup/setup.sh b/setup/setup.sh
index 39a00d8e8..7443c3b4e 100755
--- a/setup/setup.sh
+++ b/setup/setup.sh
@@ -1,18 +1,14 @@
#!/bin/sh
-if which java &>/dev/null
-then
- if java -jar test.jar
- then
- mkdir -p /opt/traccar
- cp -r * /opt/traccar
- rm -r ../out
- rm /opt/traccar/setup.sh
- chmod -R go+rX /opt/traccar
- /opt/traccar/bin/installDaemon.sh
- else
- echo 'Java 7 or higher is required'
- fi
-else
- echo 'Java runtime is required'
-fi
+mkdir -p /opt/traccar
+cp -r * /opt/traccar
+chmod -R go+rX /opt/traccar
+
+mv /opt/traccar/traccar.service /etc/systemd/system
+chmod 664 /etc/systemd/system/traccar.service
+
+systemctl daemon-reload
+systemctl enable traccar.service
+
+rm /opt/traccar/setup.sh
+rm -r ../out