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