setup revision 873
2N/A#!/bin/sh
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License, Version 1.0 only
2N/A# (the "License"). You may not use this file except in compliance
2N/A# with the License.
2N/A#
2N/A# You can obtain a copy of the license at
2N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE
2N/A# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at
2N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2N/A# add the following below this CDDL HEADER, with the fields enclosed
2N/A# by brackets "[]" replaced with your own identifying information:
2N/A# Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A#
2N/A# Portions Copyright 2006-2007 Sun Microsystems, Inc.
2N/A
2N/A
2N/A# See if JAVA_HOME is set. If not, then see if there is a java executable in
2N/A# the path and try to figure it out.
2N/Aif test -z "${JAVA_BIN}"
2N/Athen
2N/A if test -z "${JAVA_HOME}"
2N/A then
2N/A if test -f "${INSTANCE_ROOT}/bin/set-java-home"
2N/A then
2N/A . "${INSTANCE_ROOT}/bin/set-java-home"
2N/A JAVA_BIN="${JAVA_HOME}/bin/java"
2N/A export JAVA_BIN
2N/A else
2N/A JAVA_BIN=`which java 2> /dev/null`
2N/A if test ${?} -eq 0
2N/A then
2N/A export JAVA_BIN
2N/A else
2N/A echo "Please set JAVA_HOME to the root of a Java 5.0 installation."
2N/A exit 1
2N/A fi
2N/A fi
2N/A else
2N/A JAVA_BIN="${JAVA_HOME}/bin/java"
2N/A export JAVA_BIN
2N/A fi
2N/Afi
2N/A
2N/A
2N/A# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
2N/A# system environment variables for security and compatibility reasons.
2N/APATH=/bin:/usr/bin
2N/ALD_LIBRARY_PATH=
2N/ALD_LIBRARY_PATH_32=
2N/ALD_LIBRARY_PATH_64=
2N/ALD_PRELOAD=
2N/ALD_PRELOAD_32=
2N/ALD_PRELOAD_64=
2N/Aexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
2N/A LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_34
2N/A
2N/A
2N/A# Capture the current working directory so that we can change to it later.
2N/A# Then capture the location of this script and the Directory Server instance
2N/A# root so that we can use them to create appropriate paths.
2N/AWORKING_DIR=`pwd`
2N/A
2N/Acd `dirname "${0}"`
2N/ASCRIPT_DIR=`pwd`
2N/A
2N/AINSTANCE_ROOT=${SCRIPT_DIR}
2N/Aexport INSTANCE_ROOT
2N/A
2N/Acd "${WORKING_DIR}"
2N/A
2N/A
2N/A# Configure the appropriate CLASSPATH.
2N/ACLASSPATH=${INSTANCE_ROOT}/classes
2N/Afor JAR in ${INSTANCE_ROOT}/lib/*.jar
2N/Ado
2N/A CLASSPATH=${CLASSPATH}:${JAR}
2N/Adone
2N/Aexport CLASSPATH
# Determine whether the detected Java environment is acceptable for use.
if test -z "${JAVA_ARGS}"
then
"${JAVA_BIN}" -client org.opends.server.tools.InstallDS -t 2> /dev/null
if test ${?} -eq 0
then
JAVA_ARGS="-client"
else
"${JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
if test ${?} -ne 0
then
echo "ERROR: The detected Java version could not be used. Please set "
echo " JAVA_HOME to the root of a Java 5.0 installation."
exit 1
fi
fi
else
"${JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
if test ${?} -ne 0
then
echo "ERROR: The detected Java version could not be used. Please set "
echo " JAVA_HOME to the root of a Java 5.0 installation."
exit 1
fi
fi
# Launch the setup process.
"${JAVA_BIN}" org.opends.quicksetup.installer.InstallLauncher -P setup "${@}"