diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-16 13:09:05 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 13:09:05 +1300 |
commit | 1ff7c6aed54ffc3e26e50e5cbe64d39c4b38a0c0 (patch) | |
tree | e1f69e3d3e3be3fed0678a29afec099dc6727005 /setup/other | |
parent | 57b831ca0b08c3ac2c4aa93b9ba2a3c44d78344b (diff) | |
parent | ae0a8ead9274b72f52552ce475cdb97a9bf68d4f (diff) | |
download | trackermap-server-1ff7c6aed54ffc3e26e50e5cbe64d39c4b38a0c0.tar.gz trackermap-server-1ff7c6aed54ffc3e26e50e5cbe64d39c4b38a0c0.tar.bz2 trackermap-server-1ff7c6aed54ffc3e26e50e5cbe64d39c4b38a0c0.zip |
Merge pull request #2535 from CVSz/patch-2
Add Service traccar server for package_universal
Diffstat (limited to 'setup/other')
-rw-r--r-- | setup/other/traccar.sh | 48 |
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 |