From fe143d9a59ed148e507289420ea7c54bb3daff54 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 02 Apr 2008 15:16:09 +0000
Subject: [PATCH] Fix for issue 2444 (Commands setup/start/etc... should check Java release and reject unsupported ones)

---
 opends/resource/bin/_script-util.sh |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/opends/resource/bin/_script-util.sh b/opends/resource/bin/_script-util.sh
index 459bfdf..d053a21 100644
--- a/opends/resource/bin/_script-util.sh
+++ b/opends/resource/bin/_script-util.sh
@@ -71,7 +71,14 @@
   if test -z "${OPENDS_JAVA_ARGS}"
   then
     "${OPENDS_JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
-    if test ${?} -ne 0
+    RESULT_CODE=${?}
+    if test ${RESULT_CODE} -eq 13
+    then
+      # This is a particular error code that means that the Java version is 5
+      # but not supported.  Let InstallDS to display the localized error message
+      "${OPENDS_JAVA_BIN}" org.opends.server.tools.InstallDS -t
+      exit 1
+    elif test ${RESULT_CODE} -ne 0
     then
       echo "ERROR:  The detected Java version could not be used.  The detected"
       echo "java binary is:"
@@ -91,7 +98,14 @@
     fi
   else
     "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
-    if test ${?} -ne 0
+    RESULT_CODE=${?}
+    if test ${RESULT_CODE} -eq 13
+    then
+      # This is a particular error code that means that the Java version is 5
+      # but not supported.  Let InstallDS to display the localized error message
+      "${OPENDS_JAVA_BIN}" org.opends.server.tools.InstallDS -t
+      exit 1
+    elif test ${RESULT_CODE} -ne 0
     then
       echo "ERROR:  The detected Java version could not be used with the set of java"
       echo "arguments ${OPENDS_JAVA_ARGS}."

--
Gitblit v1.10.0