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