From 6c302a650cfb67506c51ca14d5e16bbf2709c8f4 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Jul 2017 17:14:14 +1200 Subject: Split setup script again --- setup/package.sh | 17 ++--------------- setup/setup.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 15 deletions(-) create mode 100755 setup/setup.sh diff --git a/setup/package.sh b/setup/package.sh index d9276731c..7bc556e9e 100755 --- a/setup/package.sh +++ b/setup/package.sh @@ -118,21 +118,8 @@ package_unix () { find out -type f \( -name \*.sh -o -name \*.vm \) -print0 | xargs -0 dos2unix copy_files - makeself out traccar.run "traccar" "\ -if which java &>/dev/null ; \ -then \ -if [ \$(java -version 2>&1 | grep -i version | sed 's/.*version \"\(.*\)\.\(.*\)\..*\"/\1\2/; 1q') -lt 17 ] ; \ -then \ -echo 'Java 7 or higher required' ; \ -else \ -mkdir -p /opt/traccar ; \ -cp -r * /opt/traccar ; \ -chmod -R go+rX /opt/traccar ; \ -/opt/traccar/bin/installDaemon.sh ; \ -fi ; \ -else \ -echo 'Java runtime is required' ; \ -fi" + cp setup.sh out + makeself out traccar.run "traccar" ./setup.sh zip -j traccar-linux-$VERSION.zip traccar.run README.txt cp traccar-linux-$VERSION.zip traccar-macos-$VERSION.zip diff --git a/setup/setup.sh b/setup/setup.sh new file mode 100755 index 000000000..502c0397b --- /dev/null +++ b/setup/setup.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if which java &>/dev/null +then + if [ $(java -version 2>&1 | grep -i version | sed 's/.*version \"\(.*\)\.\(.*\)\..*\"/\1\2/; 1q') -lt 17 ] + then + echo 'Java 7 or higher required' + else + mkdir -p /opt/traccar + cp -r * /opt/traccar + rm /opt/traccar/setup.sh + chmod -R go+rX /opt/traccar + /opt/traccar/bin/installDaemon.sh + fi +else + echo 'Java runtime is required' +fi -- cgit v1.2.3