uninstall revision 623
304N/A#!/bin/sh
304N/A#
304N/A# CDDL HEADER START
304N/A#
911N/A# The contents of this file are subject to the terms of the
851N/A# Common Development and Distribution License, Version 1.0 only
304N/A# (the "License"). You may not use this file except in compliance
304N/A# with the License.
304N/A#
304N/A# You can obtain a copy of the license at
304N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE
304N/A# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
304N/A# See the License for the specific language governing permissions
304N/A# and limitations under the License.
304N/A#
304N/A# When distributing Covered Code, include this CDDL HEADER in each
304N/A# file and include the License file at
304N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
304N/A# add the following below this CDDL HEADER, with the fields enclosed
304N/A# by brackets "[]" replaced with your own identifying * information:
304N/A# Portions Copyright [yyyy] [name of copyright owner]
304N/A#
304N/A# CDDL HEADER END
304N/A#
304N/A#
304N/A# Portions Copyright 2006 Sun Microsystems, Inc.
304N/A
304N/A
304N/A# See if JAVA_HOME is set. If not, then see if there is a java executable in
304N/A# the path and try to figure it out.
304N/Aif test -z "${JAVA_BIN}"
304N/Athen
304N/A if test -z "${JAVA_HOME}"
304N/A then
304N/A if test -f "${INSTANCE_ROOT}/bin/set-java-home"
493N/A then
304N/A . "${INSTANCE_ROOT}/bin/set-java-home"
304N/A JAVA_BIN="${JAVA_HOME}/bin/java"
851N/A export JAVA_BIN
304N/A else
911N/A JAVA_BIN=`which java 2> /dev/null`
911N/A if test ${?} -eq 0
911N/A then
911N/A export JAVA_BIN
304N/A else
304N/A echo "Please set JAVA_HOME to the root of a Java 5.0 installation."
304N/A exit 1
304N/A fi
304N/A fi
304N/A else
493N/A JAVA_BIN="${JAVA_HOME}/bin/java"
493N/A export JAVA_BIN
304N/A fi
304N/Afi
# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
# system environment variables for security and compatibility reasons.
PATH=/bin:/usr/bin
LD_LIBRARY_PATH=
LD_LIBRARY_PATH_32=
LD_LIBRARY_PATH_64=
LD_PRELOAD=
LD_PRELOAD_32=
LD_PRELOAD_64=
export PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_34
# Capture the current working directory so that we can change to it later.
# Then capture the location of this script and the Directory Server instance
# root so that we can use them to create appropriate paths.
WORKING_DIR=`pwd`
cd `dirname "${0}"`
SCRIPT_DIR=`pwd`
INSTANCE_ROOT=${SCRIPT_DIR}
export INSTANCE_ROOT
cd "${WORKING_DIR}"
# Configure the appropriate CLASSPATH to test.
CLASSPATH=${INSTANCE_ROOT}/classes
for JAR in ${INSTANCE_ROOT}/lib/*.jar
do
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 "${@}"