aboutsummaryrefslogtreecommitdiff
path: root/setup/other/traccar.sh
diff options
context:
space:
mode:
authorPhilipp Prangenberg <philipp.prangenberg@derkurier.de>2016-12-05 12:03:08 +0100
committerPhilipp Prangenberg <philipp.prangenberg@derkurier.de>2016-12-05 12:03:08 +0100
commita21f436a58133f7da0cae06366d729665f3b8f9c (patch)
tree72ff1743d96f79e4a9d85b0d48715e5f9aa67cf9 /setup/other/traccar.sh
parent960bf899414d89221e92138fdb98777c3f4f73ec (diff)
parent40607036c5aa6385a7ae3f3a283bf107238a5944 (diff)
downloadtrackermap-server-a21f436a58133f7da0cae06366d729665f3b8f9c.tar.gz
trackermap-server-a21f436a58133f7da0cae06366d729665f3b8f9c.tar.bz2
trackermap-server-a21f436a58133f7da0cae06366d729665f3b8f9c.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'setup/other/traccar.sh')
-rw-r--r--setup/other/traccar.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/setup/other/traccar.sh b/setup/other/traccar.sh
new file mode 100644
index 000000000..fdf1b78e4
--- /dev/null
+++ b/setup/other/traccar.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#service traccar server for universal version
+#e.g. ./traccar.sh start
+#e.g. ./traccar.sh stop
+#e.g. ./traccar.sh restart
+
+SERVICE_NAME=traccar
+PATH_TO_JAR=tracker-server.jar
+PATH_TO_CONF=conf/traccar.xml
+PID_PATH_NAME=/tmp/traccar-pid
+case $1 in
+ start)
+ echo "Starting $SERVICE_NAME ..."
+ if [ ! -f $PID_PATH_NAME ]; then
+ nohup java -jar $PATH_TO_JAR $PATH_TO_CONF /tmp 2>> /dev/null >> /dev/null &
+ echo $! > $PID_PATH_NAME
+ echo "$SERVICE_NAME started ..."
+ else
+ echo "$SERVICE_NAME is already running ..."
+ fi
+ ;;
+ stop)
+ if [ -f $PID_PATH_NAME ]; then
+ PID=$(cat $PID_PATH_NAME);
+ echo "$SERVICE_NAME stoping ..."
+ kill $PID;
+ echo "$SERVICE_NAME stopped ..."
+ rm $PID_PATH_NAME
+ else
+ echo "$SERVICE_NAME is not running ..."
+ fi
+ ;;
+ restart)
+ if [ -f $PID_PATH_NAME ]; then
+ PID=$(cat $PID_PATH_NAME);
+ echo "$SERVICE_NAME stopping ...";
+ kill $PID;
+ echo "$SERVICE_NAME stopped ...";
+ rm $PID_PATH_NAME
+ echo "$SERVICE_NAME starting ..."
+ nohup java -jar $PATH_TO_JAR $PATH_TO_CONF /tmp 2>> /dev/null >> /dev/null &
+ echo $! > $PID_PATH_NAME
+ echo "$SERVICE_NAME started ..."
+ else
+ echo "$SERVICE_NAME is not running ..."
+ fi
+ ;;
+esac