_mixed-script.sh revision 3885
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Common Development and Distribution License, Version 1.0 only
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# (the "License"). You may not use this file except in compliance
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You can obtain a copy of the license at
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# file and include the License file at
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# add the following below this CDDL HEADER, with the fields enclosed
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# by brackets "[]" replaced with your own identifying information:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Copyright 2008 Sun Microsystems, Inc.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# This script is used to invoke processes that might be run on server or
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# in client mode (depending on the state of the server and the arguments
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# passed). It should not be invoked directly by end users.
9512fe850e98fdd448c638ca63fdd92a8a510255ahlif test -z "${OPENDS_INVOKE_CLASS}"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl echo "ERROR: OPENDS_INVOKE_CLASS environment variable is not set."
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Capture the current working directory so that we can change to it later.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Then capture the location of this script and the Directory Server install
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# and instance root so that we can use them to create appropriate paths.
9512fe850e98fdd448c638ca63fdd92a8a510255ahlcd "${WORKING_DIR}"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# We keep this values to reset the environment before calling _script-util.sh
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# for the second time.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Set environment variables
9512fe850e98fdd448c638ca63fdd92a8a510255ahl. "${INSTALL_ROOT}/lib/_script-util.sh"
9512fe850e98fdd448c638ca63fdd92a8a510255ahlSCRIPT_NAME_ARG=-Dorg.opends.server.scriptName=${OLD_SCRIPT_NAME}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Check whether is local or remote
9512fe850e98fdd448c638ca63fdd92a8a510255ahl"${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} ${SCRIPT_NAME_ARG} "${OPENDS_INVOKE_CLASS}" \
9512fe850e98fdd448c638ca63fdd92a8a510255ahl --configClass org.opends.server.extensions.ConfigFileHandler \
9512fe850e98fdd448c638ca63fdd92a8a510255ahl --configFile "${INSTANCE_ROOT}/config/config.ldif" --testIfOffline "${@}"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl # Set the original values that the user had on the environment in order to be
9512fe850e98fdd448c638ca63fdd92a8a510255ahl # sure that the script works with the proper arguments (in particular
9512fe850e98fdd448c638ca63fdd92a8a510255ahl # if the user specified not to overwrite the environment).
9512fe850e98fdd448c638ca63fdd92a8a510255ahl # Set the environment to use the offline properties
9512fe850e98fdd448c638ca63fdd92a8a510255ahl . "${INSTALL_ROOT}/lib/_script-util.sh"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl # This is likely a problem with the provided arguments.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl SCRIPT_NAME_ARG=-Dorg.opends.server.scriptName=${OLD_SCRIPT_NAME}
9512fe850e98fdd448c638ca63fdd92a8a510255ahl # Launch the server utility.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} ${SCRIPT_NAME_ARG} "${OPENDS_INVOKE_CLASS}" \
9512fe850e98fdd448c638ca63fdd92a8a510255ahl --configClass org.opends.server.extensions.ConfigFileHandler \
9512fe850e98fdd448c638ca63fdd92a8a510255ahl --configFile "${INSTANCE_ROOT}/config/config.ldif" "${@}"