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