aboutsummaryrefslogtreecommitdiff
path: root/setup/unix/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'setup/unix/setup.sh')
-rwxr-xr-xsetup/unix/setup.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/setup/unix/setup.sh b/setup/unix/setup.sh
index 902139a1a..478966ea0 100755
--- a/setup/unix/setup.sh
+++ b/setup/unix/setup.sh
@@ -2,13 +2,18 @@
UNIX_PATH="/opt/traccar"
-if [ $(java -version 2>&1 | grep -i version | sed 's/.*version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') -lt 17 ]
+if which java &>/dev/null
then
- echo "Please install Java version 7 or higher"
+ 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 $UNIX_PATH
+ cp -rf * $UNIX_PATH
+ chmod -R go+rX $UNIX_PATH
+ $UNIX_PATH/bin/traccar install
+ rm $UNIX_PATH/setup.sh
+ fi
else
- mkdir -p $UNIX_PATH
- cp -rf * $UNIX_PATH
- chmod -R go+rX $UNIX_PATH
- $UNIX_PATH/bin/traccar install
- rm $UNIX_PATH/setup.sh
+ echo "Java runtime is required"
fi