setup revision 873
c20e7e3e6b1dd174c025487ceef713f07d77ba4bneil_a_wilson# CDDL HEADER START
e4ff5e7757146c139160c3e78f4ac5ee1584dde5coulbeck# The contents of this file are subject to the terms of the
e4ff5e7757146c139160c3e78f4ac5ee1584dde5coulbeck# Common Development and Distribution License, Version 1.0 only
267e43ad6455f631dfdb9e552909a137b9e4f087boli# (the "License"). You may not use this file except in compliance
267e43ad6455f631dfdb9e552909a137b9e4f087boli# with the License.
78ebdb0fc9f2a940f8385300ee5b4952d225b899boli# You can obtain a copy of the license at
a89f073e2246d8dc081ec584f19bbcd813b9a44cneil_a_wilson# trunk/opends/resource/legal-notices/OpenDS.LICENSE
a89f073e2246d8dc081ec584f19bbcd813b9a44cneil_a_wilson# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
a89f073e2246d8dc081ec584f19bbcd813b9a44cneil_a_wilson# See the License for the specific language governing permissions
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# and limitations under the License.
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# When distributing Covered Code, include this CDDL HEADER in each
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# file and include the License file at
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# add the following below this CDDL HEADER, with the fields enclosed
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# by brackets "[]" replaced with your own identifying information:
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# Portions Copyright [yyyy] [name of copyright owner]
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# CDDL HEADER END
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# Portions Copyright 2006-2007 Sun Microsystems, Inc.
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# See if JAVA_HOME is set. If not, then see if there is a java executable in
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson# the path and try to figure it out.
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilsonif test -z "${JAVA_BIN}"
89bb69f651eab9fd3f4091800e226342444f2fb2neil_a_wilson if test -z "${JAVA_HOME}"
03839fc8bfcf7f63ca2b9d3a48faabf94642b00bdugan if test -f "${INSTANCE_ROOT}/bin/set-java-home"
03839fc8bfcf7f63ca2b9d3a48faabf94642b00bdugan . "${INSTANCE_ROOT}/bin/set-java-home"
3effb6e09816d45ff07f200fec2b6ecb9588fa7fneil_a_wilson echo "Please set JAVA_HOME to the root of a Java 5.0 installation."
af6117fa729925b9e6cccbda589fecbb83f2b70fneil_a_wilson# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
af6117fa729925b9e6cccbda589fecbb83f2b70fneil_a_wilson# system environment variables for security and compatibility reasons.
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilsonexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson# Capture the current working directory so that we can change to it later.
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson# Then capture the location of this script and the Directory Server instance
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson# root so that we can use them to create appropriate paths.
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilsoncd "${WORKING_DIR}"
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson# Configure the appropriate CLASSPATH.
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson# Determine whether the detected Java environment is acceptable for use.
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilsonif test -z "${JAVA_ARGS}"
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson "${JAVA_BIN}" -client org.opends.server.tools.InstallDS -t 2> /dev/null
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson "${JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson echo "ERROR: The detected Java version could not be used. Please set "
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson echo " JAVA_HOME to the root of a Java 5.0 installation."
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson "${JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson echo "ERROR: The detected Java version could not be used. Please set "
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson echo " JAVA_HOME to the root of a Java 5.0 installation."
7ea3e4667fd4a40f7792638bc429b36d8066557aneil_a_wilson# Launch the setup process.