_script-util.sh revision 62da52c144e8d6ba69f611c45deeeb4f985ea24c
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# CDDL HEADER START
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# The contents of this file are subject to the terms of the
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# Common Development and Distribution License, Version 1.0 only
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# (the "License"). You may not use this file except in compliance
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# with the License.
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# See the License for the specific language governing permissions
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# and limitations under the License.
923784d59ac065eee98b208dfacda6fbc24c71d6Jake Feasel# When distributing Covered Code, include this CDDL HEADER in each
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# file and include the License file at legal-notices/CDDLv1_0.txt.
4eb529f0471672590d77cf89ef23987ba2c95ff4Laszlo Hordos# If applicable, add the following below this CDDL HEADER, with the
4eb529f0471672590d77cf89ef23987ba2c95ff4Laszlo Hordos# fields enclosed by brackets "[]" replaced with your own identifying
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# information:
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# Portions Copyright [yyyy] [name of copyright owner]
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# CDDL HEADER END
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan# Copyright 2008-2009 Sun Microsystems, Inc.
e5c203467ee4398ae81a6adb63da7477451b2e77Laszlo Hordos# function that sets the java home
8166b048bd3e2106dbdeaa1a2b8a728952d788f4Laszlo Hordos if test -f "${INSTANCE_ROOT}/lib/set-java-home"
8166b048bd3e2106dbdeaa1a2b8a728952d788f4Laszlo Hordos if test ${?} -eq 0
8166b048bd3e2106dbdeaa1a2b8a728952d788f4Laszlo Hordos echo "Please set OPENDJ_JAVA_HOME to the root of a Java 5 (or later) installation"
8166b048bd3e2106dbdeaa1a2b8a728952d788f4Laszlo Hordos echo "or edit the java.properties file and then run the dsjavaproperties script to"
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos# system environment variables for security and compatibility reasons.
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos export PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos SCRIPT_NAME_ARG=-Dcom.forgerock.opendj.ldap.tools.scriptName=${SCRIPT_NAME}
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos# Configure the appropriate CLASSPATH.
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos if [ "${INSTALL_ROOT}" != "${INSTANCE_ROOT}" ]
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristl # Capture the current working directory so that we can change to it later.
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristl # Then capture the location of this script and the Directory Server instance
660a40ad15749d74efa0dd4ef12cb8781c570e22Laszlo Hordos # root so that we can use them to create appropriate paths.
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristl cd "${WORKING_DIR}"
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristlif test "${SCRIPT_UTIL_CMD}" = "set-full-environment"
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristlelif test "${SCRIPT_UTIL_CMD}" = "set-java-home-and-args"
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristlelif test "${SCRIPT_UTIL_CMD}" = "set-environment-vars"
8698e80519313c98c8d5c6de06ae04cdfc816cafMatthias Tristlelif test "${SCRIPT_UTIL_CMD}" = "set-classpath"