_script-util.sh revision 4915
0N/A# The contents of this file are subject to the terms of the 0N/A# Common Development and Distribution License, Version 1.0 only 0N/A# (the "License"). You may not use this file except in compliance 0N/A# You can obtain a copy of the license at 0N/A# See the License for the specific language governing permissions 0N/A# and limitations under the License. 0N/A# When distributing Covered Code, include this CDDL HEADER in each 0N/A# file and include the License file at 2362N/A# add the following below this CDDL HEADER, with the fields enclosed 2362N/A# by brackets "[]" replaced with your own identifying information: 2362N/A# Portions Copyright [yyyy] [name of copyright owner] 0N/A# Copyright 2008-2009 Sun Microsystems, Inc. 0N/A# Display an error message 0N/A echo "Please set OPENDS_JAVA_HOME to the root of a Java 5 (or later) installation" 0N/A echo "specify the Java version to be used" 0N/A# function that tests the JAVA_HOME env variable. 0N/A if test -z "${JAVA_HOME}" 0N/A if test -f "${OPENDS_JAVA_BIN}" 0N/A# function that tests the JAVA_BIN env variable. 0N/A if test -z "${JAVA_BIN}" 0N/A if test -f "${OPENDS_JAVA_BIN}" 0N/A# function that tests the java executable in the PATH env variable. 0N/A# function that tests the OPENDS_JAVA_HOME env variable. 0N/A if test -z "${OPENDS_JAVA_HOME}" 0N/A if test -f "${OPENDS_JAVA_BIN}" 0N/A# function that tests the OPENDS_JAVA_BIN env variable. 3323N/A if test -z "${OPENDS_JAVA_BIN}" 0N/A if test -f "${OPENDS_JAVA_BIN}" 3646N/A# function that sets the java home 3646N/A# Determine whether the detected Java environment is acceptable for use. 0N/A if test -z "${OPENDS_JAVA_ARGS}" 0N/A # This is a particular error code that means that the Java version is 5 0N/A # but not supported. Let InstallDS to display the localized error message 0N/A echo "ERROR: The detected Java version could not be used. The detected" 0N/A echo "Java binary is:" 0N/A echo "${OPENDS_JAVA_BIN}" 0N/A echo "You must specify the path to a valid Java 5.0 or higher version." 0N/A echo "The procedure to follow is:" 0N/A echo "2. Set the environment variable OPENDS_JAVA_HOME to the root of a valid " 0N/A echo "Java 5.0 installation." 0N/A echo "If you want to have specific Java settings for each command line you must" 0N/A echo "follow the steps 3 and 4." 0N/A echo "3. Edit the properties file specifying the Java binary and the Java arguments" 0N/A echo "for each command line. The Java properties file is located in:" 0N/A # This is a particular error code that means that the Java version is 5 0N/A # but not supported. Let InstallDS to display the localized error message 0N/A echo "ERROR: The detected Java version could not be used with the set of Java" 0N/A echo "arguments ${OPENDS_JAVA_ARGS}." 0N/A echo "The detected Java binary is:" 0N/A echo "${OPENDS_JAVA_BIN}" 0N/A echo "You must specify the path to a valid Java 5.0 or higher version." 0N/A echo "The procedure to follow is:" 0N/A echo "2. Set the environment variable OPENDS_JAVA_HOME to the root of a valid " 0N/A echo "Java 5.0 installation." 0N/A echo "If you want to have specific Java settings for each command line you must" 0N/A echo "follow the steps 3 and 4." 0N/A echo "3. Edit the properties file specifying the Java binary and the Java arguments" 0N/A echo "for each command line. The Java properties file is located in:" 0N/A# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important 0N/A# system environment variables for security and compatibility reasons. 0N/A# Configure the appropriate CLASSPATH. 0N/A if [ "${INSTALL_ROOT}" != "${INSTANCE_ROOT}" ] 0N/Aif test "${INSTALL_ROOT}" =
"" 0N/A # Capture the current working directory so that we can change to it later. 0N/A # Then capture the location of this script and the Directory Server instance 0N/A # root so that we can use them to create appropriate paths. 0N/Aif test "${INSTANCE_ROOT}" =
"" 0N/A if [ -f
"${INSTALL_ROOT}/configure" ]
0N/A if [
"${SCRIPT_NAME}" =
"configure" ]
0N/A echo "${INSTALL_ROOT}/configure has already been run. Exiting." 0N/A if [
"${SCRIPT_NAME}" !=
"configure" ]
0N/A echo "No instance found. Run ${INSTALL_ROOT}/configure to create it." 0N/A if [ -d
"${INSTANCE_ROOT}" ]
0N/A cd "${INSTANCE_ROOT}" 0N/Aif test "${SCRIPT_UTIL_CMD}" =
"set-full-environment-and-test-java" 0N/Aelif test "${SCRIPT_UTIL_CMD}" =
"set-full-environment" 0N/A elif test "${SCRIPT_UTIL_CMD}" =
"set-java-home-and-args" 0N/Aelif test "${SCRIPT_UTIL_CMD}" =
"set-environment-vars" 0N/Aelif test "${SCRIPT_UTIL_CMD}" =
"set-classpath" 0N/Aelif test "${SCRIPT_UTIL_CMD}" =
"test-java" 0N/Aif [
"${SCRIPT_NAME}" !=
"configure" ] && [
"${SCRIPT_NAME}" !=
"unconfigure" ]
0N/A # Perform check unless it is specified not to do it 0N/A # No check for --version or --help option 0N/A if [
"${CHECK_VERSION}" =
"yes" ]
0N/A # Launch the CheckInstance process.