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