_client-script.sh revision 5236
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#!/bin/sh
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# CDDL HEADER START
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# The contents of this file are subject to the terms of the
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Common Development and Distribution License, Version 1.0 only
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# (the "License"). You may not use this file except in compliance
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# with the License.
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# You can obtain a copy of the license at
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# trunk/opends/resource/legal-notices/OpenDS.LICENSE
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# See the License for the specific language governing permissions
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# and limitations under the License.
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# When distributing Covered Code, include this CDDL HEADER in each
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# file and include the License file at
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# add the following below this CDDL HEADER, with the fields enclosed
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# by brackets "[]" replaced with your own identifying information:
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Portions Copyright [yyyy] [name of copyright owner]
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# CDDL HEADER END
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay#
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Copyright 2006-2010 Sun Microsystems, Inc.
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
756d4b8bce5a58e5bd8fe686688b6c42d2e7052bPhill Cunnington
3547063d010b485922e56e2fe43f2f3cde2e710aJason Lemay# This script is used to invoke various client-side processes. It should not
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# be invoked directly by end users.
8774cade81dfa90b972d8b855eb249ca2568b4ddPhill Cunningtonif test -z "${OPENDS_INVOKE_CLASS}"
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemaythen
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay echo "ERROR: OPENDS_INVOKE_CLASS environment variable is not set."
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay exit 1
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemayfi
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Capture the current working directory so that we can change to it later.
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Then capture the location of this script and the Directory Server install
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# root so that we can use them to create appropriate paths.
93ec516f9f64e9474816cd56a19b6d297796e83bJason LemayWORKING_DIR=`pwd`
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemaycd "`dirname "${0}"`"
93ec516f9f64e9474816cd56a19b6d297796e83bJason LemaySCRIPT_DIR=`pwd`
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemaycd ..
93ec516f9f64e9474816cd56a19b6d297796e83bJason LemayINSTALL_ROOT=`pwd`
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemayexport INSTALL_ROOT
3547063d010b485922e56e2fe43f2f3cde2e710aJason Lemay
3547063d010b485922e56e2fe43f2f3cde2e710aJason Lemaycd "${WORKING_DIR}"
3547063d010b485922e56e2fe43f2f3cde2e710aJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Set environment variables
93ec516f9f64e9474816cd56a19b6d297796e83bJason LemaySCRIPT_UTIL_CMD=set-full-environment
3547063d010b485922e56e2fe43f2f3cde2e710aJason Lemayexport SCRIPT_UTIL_CMD
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemayif [ -z "$NO_CHECK" ]
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemaythen
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay NO_CHECK=1
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay export NO_CHECK
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemayfi
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay. "${INSTALL_ROOT}/lib/_script-util.sh"
93ec516f9f64e9474816cd56a19b6d297796e83bJason LemayRETURN_CODE=$?
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemayif test ${RETURN_CODE} -ne 0
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemaythen
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay exit ${RETURN_CODE}
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemayfi
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay# Launch the appropriate client utility.
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay"${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} ${SCRIPT_ARGS} ${SCRIPT_NAME_ARG} "${OPENDS_INVOKE_CLASS}" "${@}"
93ec516f9f64e9474816cd56a19b6d297796e83bJason Lemay