uninstall revision 37f9a536593b696e5a3dcec443e1475f22fb5afd
70N/A#!/bin/sh
70N/A#
1357N/A# CDDL HEADER START
70N/A#
70N/A# The contents of this file are subject to the terms of the
919N/A# Common Development and Distribution License, Version 1.0 only
919N/A# (the "License"). You may not use this file except in compliance
919N/A# with the License.
919N/A#
919N/A# You can obtain a copy of the license at
919N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE
919N/A# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at
919N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
919N/A# add the following below this CDDL HEADER, with the fields enclosed
919N/A# by brackets "[]" replaced with your own identifying information:
919N/A# Portions Copyright [yyyy] [name of copyright owner]
919N/A#
70N/A# CDDL HEADER END
70N/A#
70N/A#
70N/A# Portions Copyright 2006-2007 Sun Microsystems, Inc.
851N/A
851N/A
851N/A# This script may be used to uninstall the server.
851N/A
851N/A# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
98N/A# system environment variables for security and compatibility reasons.
551N/APATH=/bin:/usr/bin
321N/ALD_LIBRARY_PATH=
321N/ALD_LIBRARY_PATH_32=
550N/ALD_LIBRARY_PATH_64=
550N/ALD_PRELOAD=
213N/ALD_PRELOAD_32=
649N/ALD_PRELOAD_64=
304N/Aexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
530N/A LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_34
425N/A
425N/A
325N/A# Capture the current working directory so that we can change to it later.
493N/A# Then capture the location of this script and the Directory Server instance
536N/A# root so that we can use them to create appropriate paths.
456N/AWORKING_DIR=`pwd`
320N/A
332N/Acd `dirname "${0}"`
501N/ASCRIPT_DIR=`pwd`
231N/A
550N/AINSTANCE_ROOT=${SCRIPT_DIR}
347N/Aexport INSTANCE_ROOT
532N/A
463N/Acd "${WORKING_DIR}"
493N/A
425N/A# See if the environment variables are set. If not, then see if there is a java
493N/A# executable in the path and try to figure it out.
791N/Aif test -z "${OPENDS_JAVA_BIN}"
472N/Athen
324N/A if test -z "${OPENDS_JAVA_HOME}"
347N/A then
310N/A if test -f "${INSTANCE_ROOT}/lib/set-java-home"
316N/A then
474N/A . "${INSTANCE_ROOT}/lib/set-java-home"
290N/A OPENDS_JAVA_BIN="${OPENDS_JAVA_HOME}/bin/java"
332N/A export OPENDS_JAVA_BIN
464N/A else
332N/A if test -z "${JAVA_BIN}"
509N/A then
835N/A if test -z "${JAVA_HOME}"
835N/A then
332N/A OPENDS_JAVA_BIN=`which java 2> /dev/null`
210N/A if test ${?} -eq 0
493N/A then
792N/A export OPENDS_JAVA_BIN
128N/A else
414N/A echo "Please set OPENDS_JAVA_HOME to the root of a Java 5 (or later) installation."
484N/A exit 1
326N/A fi
493N/A else
335N/A OPENDS_JAVA_BIN="${JAVA_HOME}/bin/java"
493N/A export OPENDS_JAVA_BIN
493N/A fi
729N/A else
425N/A OPENDS_JAVA_BIN="${JAVA_BIN}"
370N/A export OPENDS_JAVA_BIN
70N/A fi
400N/A fi
294N/A else
435N/A OPENDS_JAVA_BIN="${OPENDS_JAVA_HOME}/bin/java"
800N/A export OPENDS_JAVA_BIN
98N/A fi
434N/Afi
505N/A
277N/A
433N/A# Configure the appropriate CLASSPATH.
546N/ACLASSPATH=${INSTANCE_ROOT}/classes
356N/Afor JAR in ${INSTANCE_ROOT}/lib/*.jar
289N/Ado
326N/A CLASSPATH=${CLASSPATH}:${JAR}
439N/Adone
501N/Aexport CLASSPATH
469N/A
290N/A
542N/A# Determine whether the detected Java environment is acceptable for use.
424N/Aif test -z "${JAVA_ARGS}"
286N/Athen
90N/A "${OPENDS_JAVA_BIN}" -client org.opends.server.tools.InstallDS -t 2> /dev/null
475N/A if test ${?} -eq 0
295N/A then
70N/A JAVA_ARGS="-client"
299N/A else
262N/A "${OPENDS_JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
539N/A if test ${?} -ne 0
277N/A then
332N/A echo "ERROR: The detected Java version could not be used. Please set "
332N/A echo " OPENDS_JAVA_HOME to the root of a Java 5 (or later) installation."
493N/A exit 1
70N/A fi
70N/A fi
319N/Aelse
280N/A "${OPENDS_JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
319N/A if test ${?} -ne 0
70N/A then
1117N/A echo "ERROR: The detected Java version could not be used. Please set "
1117N/A echo " OPENDS_JAVA_HOME to the root of a Java 5 (or later) installation."
98N/A exit 1
1357N/A fi
1357N/Afi
98N/A
744N/A# Launch the uninstall process.
1104N/A"${OPENDS_JAVA_BIN}" -Dorg.opends.server.scriptName=uninstall org.opends.guitools.uninstaller.UninstallLauncher "${@}"
744N/A
763N/A# return part
1122N/ARETURN_CODE=$?
763N/Aif test ${RETURN_CODE} -eq 50
763N/Athen
744N/A # Version info was on requested
493N/A exit 0
967N/Aelse
70N/A exit ${RETURN_CODE}
493N/Afi
493N/A