2018-01-06 02:18:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
okCount=0
|
|
|
|
|
|
|
|
# Java check.
|
|
|
|
javaCheck=`which java`
|
|
|
|
if [[ "$javaCheck" =~ ^/.* ]]; then
|
|
|
|
echo "Java requirement............... OK"
|
|
|
|
let "okCount+=1"
|
|
|
|
else
|
|
|
|
echo "Java requirement............... MISSING"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Java version check.
|
|
|
|
javaVersionCheck=`java -version 2>&1`
|
|
|
|
if [[ "$javaVersionCheck" =~ ^.*\ 1.8 ]]; then
|
|
|
|
echo "Java 8 version requirement..... OK"
|
|
|
|
let "okCount+=1"
|
|
|
|
else
|
|
|
|
echo "Java 8 version requirement..... MISSING"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$okCount" == 2 ]; then
|
|
|
|
java -jar hebdobot.jar $@
|
|
|
|
else
|
|
|
|
echo "Sorry, Hebdobot launch requires Java 8, abort."
|
|
|
|
fi
|