#
# $Id$
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at
# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
# add the following below this CDDL HEADER, with the fields enclosed
# by brackets "[]" replaced with your own identifying information:
# Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2006-2010 Sun Microsystems, Inc.
# Portions Copyright 2011 ForgeRock AS
# Portions Copyright 2013 Jens Elkner
# This script is used to invoke various client-side processes. It should not
# be invoked directly by end users.
INSTALL_ROOT="${.sh.file%/*/*}"
CHECK=''
if [[ -z ${OPENDJ_INVOKE_CLASS} || -z ${SCRIPT_NAME} ]]; then
OIC=''
case "$SCRIPT_NAME" in
base64) #link
;;
# display the control panel
;;
CHECK='-i'
;;
dsconfig) #link
# perform configuration ops on the server
;;
dsframework) #link
# perform ops with the global admin framework
;;
dsjavaproperties) #link
# Basically reads $INSTANCE_ROOT/config/java.properties and creates
# $INSTANCE_ROOT/lib/set-java-home, which gets sourced by
# $INSTALL_ROOT/lib/_script-util.sh ...
CHECK='-i'
;;
ldapcompare) #link
# perform LDAP compare ops
;;
ldapdelete) #link
# perform LDAP delete ops
;;
ldapmodify) #link
# perform LDAP add, delete, modify, and modify DN ops
;;
ldappasswordmodify) #link
# perform LDAP password modify ops
;;
ldapsearch) #link
# perform LDAP search ops
;;
;;
# manage tasks in the Directory Server
;;
status) #link
# display the status panel
;;
esac
fi
if [[ -z ${OPENDJ_INVOKE_CLASS} ]]; then
print -u2 'ERROR: OPENDJ_INVOKE_CLASS environment variable is not set.'
exit 1
fi
# Set environment variables
# special for src/quicksetup/org/opends/quicksetup/util/Utils.java
if [[ ${SCRIPT_UTIL_CMD} == 'set-full-environment-and-test-java' ]]; then
return 0
fi
# "OpenDJ Admin" (ODA) profile support: let the ODA specify as an additional
# argument, what file to use (because per default ODA has no permission to
# modify files in ${INSTANCE_ROOT}).
if [[ -f "${FILE}" ]]; then
if [[ $1 == '-Q' ]]; then
shift 2
set -- '-Q' "$@"
else
shift
fi
fi
fi
# Launch the appropriate client utility.
-Dorg.opends.server.InstallRoot="${INSTALL_ROOT}" \
-Dorg.opends.server.InstanceRoot="${INSTANCE_ROOT}" \
${OPENDJ_INVOKE_CLASS} "$@"