Commit 63159924 authored by Holger Levsen's avatar Holger Levsen

merge changes from updated package

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 71aae151
......@@ -26,8 +26,6 @@ DAEMON=/usr/bin/daemon
DAEMON_ARGS="--name=$NAME --inherit --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE"
JAVA=`type -p java`
JAVA_ALLOWED_VERSION="18"
if [ -n "$UMASK" ]; then
DAEMON_ARGS="$DAEMON_ARGS --umask=$UMASK"
fi
......@@ -56,10 +54,12 @@ if [ -z "$JAVA" ]; then
exit 1
fi
# Which Java versions can be used to run Jenkins
JAVA_ALLOWED_VERSIONS=( "18" "110" )
# Work out the JAVA version we are working with:
JAVA_VERSION=$($JAVA -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;')
JAVA_VERSION=$($JAVA -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*".*/\1\2/p;')
if [ "$JAVA_VERSION" = "$JAVA_ALLOWED_VERSION" ]; then
if [[ ${JAVA_ALLOWED_VERSIONS[*]} =~ "$JAVA_VERSION" ]]; then
echo "Correct java version found" >&2
else
echo "Found an incorrect Java version" >&2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment