hebdobot/resources/scripts/hebdobot.sh

29 lines
563 B
Bash
Raw Normal View History

#!/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