setup revision 74dca04245920444925c2544c591c3da5dad607e
2N/A#!/bin/sh
2N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2N/A#
2N/A# Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
2N/A#
2N/A# The contents of this file are subject to the terms
2N/A# of the Common Development and Distribution License
2N/A# (the License). You may not use this file except in
2N/A# compliance with the License.
2N/A#
2N/A# You can obtain a copy of the License at
2N/A# https://opensso.dev.java.net/public/CDDLv1.0.html or
2N/A# opensso/legal/CDDLv1.0.txt
2N/A# See the License for the specific language governing
2N/A# permission and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL
2N/A# Header Notice in each file and include the License file
2N/A# at opensso/legal/CDDLv1.0.txt.
2N/A# If applicable, add the following below the CDDL Header,
2N/A# with the fields enclosed by brackets [] replaced by
2N/A# your own identifying information:
2N/A# "Portions Copyrighted [year] [name of copyright owner]"
2N/A#
2N/A# $Id: setup,v 1.11 2009/01/28 05:34:46 ww203982 Exp $
2N/A#
2N/A
2N/A# Portions Copyrighted 2010-2014 ForgeRock AS.
2N/A
2N/Aif [ -z "$JAVA_HOME" ]; then
2N/A echo "Please define JAVA_HOME environment variable before running this program"
2N/A echo "setup program will use the JVM defined in JAVA_HOME for all the CLI tools"
2N/A exit 1
2N/Afi
2N/A
2N/Aif [ ! -x "$JAVA_HOME"/bin/java ]; then
2N/A echo "The defined JAVA_HOME environment variable is not correct"
2N/A echo "setup program will use the JVM defined in JAVA_HOME for all the CLI tools"
2N/A exit 1
2N/Afi
2N/A
2N/AAWK=`which awk`
2N/Aif [ -z $AWK ]; then
2N/A echo "setup fails because awk is not found"
2N/A exit 1
2N/Afi
2N/A
2N/AJAVA_VER=`$JAVA_HOME/bin/java -version 2>&1 | $AWK -F'"' '{print $2}'`
2N/A
2N/Acase $JAVA_VER in
2N/A1.0* | 1.1* | 1.2* | 1.3*)
2N/A echo "This program is designed to work with 1.4 or newer JRE."
2N/A exit 0
2N/A ;;
2N/Aesac
2N/A
2N/Awhile test $# -gt 0
2N/Ado
2N/A case "$1" in
2N/A --acceptLicense) accept_license=--acceptLicense
2N/A ;;
2N/A -h) help_print=yes
2N/A ;;
2N/A --help) help_print=yes
2N/A ;;
2N/A -d) shift
2N/A path_debug=$1
2N/A ;;
2N/A --debug) shift
2N/A path_debug=$1
2N/A ;;
2N/A -p) shift
2N/A path_AMConfig=$1
2N/A ;;
2N/A --path) shift
2N/A path_AMConfig=$1
2N/A ;;
2N/A -l) shift
2N/A path_log=$1
2N/A ;;
2N/A --log) shift
2N/A path_log=$1
2N/A ;;
2N/A esac
2N/A shift
2N/Adone
2N/A
2N/ACLASSPATH=""
2N/ACLASSPATH="$CLASSPATH:lib/opendj-server-${opendj.server.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/forgerock-util-${commons.forgerock-util.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/json-${json.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/xalan-${xalan.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/xercesImpl-${xercesj.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/xml-apis-${xercesj.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/xmlsec-${santuario.xmlsec.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-core-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-entitlements-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-shared-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-dtd-schema-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-rest-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-license-manager-cli-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/openam-license-core-${project.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/forgerock-guice-core-${forgerock.guice.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/guice-${guice.version}-no_aop.jar"
2N/ACLASSPATH="$CLASSPATH:lib/commons-lang-${commons-lang.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/javax.inject-${javax.inject.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/slf4j-api-${slf4j.version}.jar"
2N/ACLASSPATH="$CLASSPATH:lib/slf4j-nop-${slf4j.version}.jar"
2N/ACLASSPATH="$CLASSPATH:resources"
2N/A
2N/A$JAVA_HOME/bin/java -D"load.config=yes" -D"help.print=$help_print" \
2N/A -D"path.AMConfig=$path_AMConfig" -D"path.debug=$path_debug" \
2N/A -D"path.log=$path_log" \
2N/A -cp "$CLASSPATH" \
2N/A com.sun.identity.tools.bundles.Main $accept_license
2N/A