Merge pull request #2 from IceBurst/patch-1

Java Checks
This commit is contained in:
catbref 2020-03-30 11:32:04 +01:00 committed by GitHub
commit 1db8c06291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

17
run.sh
View File

@ -6,6 +6,23 @@ if [ "$USER" = "root" ]; then
exit exit
fi fi
# Validate Java is installed and the minimum version is available
MIN_JAVA_VER='11'
if command -v java > /dev/null 2>&1; then
version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
version=$(echo $version | cut -d'.' -f1,2)
if [ `echo "${version}>=${MIN_JAVA_VER}" | bc` -eq 1 ]; then
echo 'Passed Java version check'
else
echo 'Please upgrade your Java to version 11 or greater'
exit 1
fi
else
echo 'Java is not available, please install Java 11 or greater'
exit 1
fi
# No qortal.jar but we have a Maven built one? # No qortal.jar but we have a Maven built one?
# Be helpful and copy across to correct location # Be helpful and copy across to correct location
if [ ! -e qortal.jar -a -f target/qortal*.jar ]; then if [ ! -e qortal.jar -a -f target/qortal*.jar ]; then