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