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