setup revision 1777
f0aad5341752aefe5059832f6cf3abc3283c6e16Tinderbox User# CDDL HEADER START
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# The contents of this file are subject to the terms of the
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Common Development and Distribution License, Version 1.0 only
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# (the "License"). You may not use this file except in compliance
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# with the License.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# You can obtain a copy of the license at
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# trunk/opends/resource/legal-notices/OpenDS.LICENSE
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# See the License for the specific language governing permissions
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# and limitations under the License.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# When distributing Covered Code, include this CDDL HEADER in each
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User# file and include the License file at
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# add the following below this CDDL HEADER, with the fields enclosed
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# by brackets "[]" replaced with your own identifying information:
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Portions Copyright [yyyy] [name of copyright owner]
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# CDDL HEADER END
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Portions Copyright 2006-2007 Sun Microsystems, Inc.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# See if JAVA_HOME is set. If not, then see if there is a java executable in
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# the path and try to figure it out.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterif test -z "${JAVA_BIN}"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User if test -z "${JAVA_HOME}"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if test -f "${INSTANCE_ROOT}/lib/set-java-home"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User . "${INSTANCE_ROOT}/bin/set-java-home"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater echo "Please set JAVA_HOME to the root of a Java 5 (or later) installation."
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# system environment variables for security and compatibility reasons.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Capture the current working directory so that we can change to it later.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Then capture the location of this script and the Directory Server instance
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# root so that we can use them to create appropriate paths.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatercd "${WORKING_DIR}"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# Configure the appropriate CLASSPATH.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# Determine whether the detected Java environment is acceptable for use.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userif test -z "${JAVA_ARGS}"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater "${JAVA_BIN}" -client org.opends.server.tools.InstallDS -t 2> /dev/null
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater "${JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater echo "ERROR: The detected Java version could not be used. Please set "
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater echo " JAVA_HOME to the root of a Java 5 (or later) installation."
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater "${JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt echo "ERROR: The detected Java version could not be used. Please set "
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater echo " JAVA_HOME to the root of a Java 5 (or later) installation."
1ca759b3f5c0672b2a66bc02288fe010cabbfe37Tinderbox User# Launch the setup process.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater"${JAVA_BIN}" org.opends.quicksetup.installer.InstallLauncher -P setup "${@}"
RETURN_CODE=$?
exit ${RETURN_CODE}