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