#!/bin/sh

# Copyright  2004 Sun Microsystems, Inc. All rights reserved. 
# 
# Sun Microsystems, Inc. has intellectual property rights relating to
# technology embodied in the product that is described in this document.
# In particular, and without limitation, these intellectual property rights
# may include one or more of the U.S. patents listed at
# http://www.sun.com/patents and one or more additional patents or pending
# patent applications in the U.S. and in other countries.
# 
# U.S. Government Rights - Commercial software. Government users are subject
# to the Sun Microsystems, Inc. standard license agreement and applicable
# provisions of the FAR and its supplements.
# 
# Use is subject to license terms. 
# 
# This distribution may include materials developed by third parties. Sun,
# Sun Microsystems, the Sun logo, Java and Sun[tm] ONE are trademarks or
# registered trademarks of Sun Microsystems, Inc. in the U.S. and other
# countries. 
# 
# Copyright  2004 Sun Microsystems, Inc. Tous droits rservs. Sun
# Microsystems, Inc. dtient les droits de proprit intellectuels relatifs
#  la technologie incorpore dans le produit qui est dcrit dans ce document.
# En particulier, et ce sans limitation, ces droits de proprit
# intellectuelle peuvent inclure un ou plus des brevets amricains lists
#  l'adresse http://www.sun.com/patents et un ou les brevets supplmentaires
# ou les applications de brevet en attente aux Etats - Unis et dans les
# autres pays.
# 
# L'utilisation est soumise aux termes du contrat de licence.
# 
# Cette distribution peut comprendre des composants dvelopps par des
# tierces parties.
# 
# Sun, Sun Microsystems, le logo Sun, Java et Sun[tm] ONE sont des marques
# de fabrique ou des marques dposes de Sun Microsystems, Inc. aux
# Etats-Unis et dans d'autres pays.


APPSERVER=APPSERVERDEPLOYMENT
if [ "$APPSERVER" = "true" ]; then
 DP_HOME=APPSERVERBASEDIR/${PRODUCT_DIR}
 JAVA_HOME=APPSERVERBASEDIR/ias/usr/java
else
 DP_HOME=${BASE_DIR}/${PRODUCT_DIR}
 JAVA_HOME=JDK_PATH
fi
USING_JDK14=IAS7INSTALL

AM_PKG_PREFIX=com.sun.identity.log

if [ -z "${JAVA_HOME}" ] ; then
    if [ -d /usr/java ] ; then
        JAVA_HOME=/usr/java
    else
        echo "JAVA_HOME environment variable not set." 1>&2
        exit 1
    fi
fi

JSS_JAR=TAG_JSS_JAR_PATH/jss3.jar
JSS_SO_PATH=TAG_JSS_SO_PATH
DPADMIN_JAR=${DP_HOME}/lib/am_sdk.jar:${DP_HOME}/lib/am_services.jar
LOCALE_HOME=${DP_HOME}/locale
DP_LIB=${DP_HOME}/lib
DP_CONFIG=IS_INSTALL_ETCDIR/IS_PRODNAME/config
SERVLET_JAR=${DP_HOME}/lib/servlet.jar
LOGGING_JAR=${DP_HOME}/lib/am_logging.jar

DP_CLASSPATH=${LOCALE_HOME}:${DPADMIN_JAR}:${DP_CONFIG}:${DP_LIB}:${JSS_JAR}:${SERVLET_JAR}:${LOGGING_JAR}

if [ -z "$LD_LIBRARY_PATH" ] ; then
  LD_LIBRARY_PATH=${JSS_SO_PATH}
else
  LD_LIBRARY_PATH="${JSS_SO_PATH}:$LD_LIBRARY_PATH"
fi

export LD_LIBRARY_PATH

if [ -z "$CLASSPATH" ]
then
  CLASSPATH="${DP_CLASSPATH}"
else
  CLASSPATH="${DP_CLASSPATH}:$CLASSPATH"
fi

if [ "$USING_JDK14" = "true" ]; then
  BOOTCLASSPATHOPTION=""
else
  BOOTCLASSPATHOPTION="-Xbootclasspath:${JAVA_HOME}/lib/tools.jar:${JAVA_HOME}/jre/lib/rt.jar:${DP_HOME}/lib/jdk_logging.jar"
fi

# Setup proper LD_LIBRARY_PATH if not already set
${JAVA_HOME}/jre/bin/java -Xms64m -Xmx256m -classpath ${CLASSPATH} -D"java.protocol.handler.pkgs=com.iplanet.services.comm" -D"com.iplanet.coreservices.configpath=${DP_CONFIG}/ums" -D"max_conn_pool=10" -D"min_conn_pool=1" -D"java.util.logging.config.class=com.sun.identity.log.s1is.LogConfigReader" -D"java.util.logging.manager=com.sun.identity.log.LogManager" ${BOOTCLASSPATHOPTION} ${AM_PKG_PREFIX}.cli.ISArchiveVerify "$@"
