setup revision dfc4e0fc3052835b2a069aa9d869fa1161c33fe6
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-2013 ForgeRock, Inc.
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/Aif [ "$1" = "-h" -o "$1" = "--help" ] ; then
2N/A help_print=yes
2N/Afi
2N/Aif [ "$1" = "-l" -o "$1" = "--log" ] ; then
2N/A path_log="$2"
2N/Afi
if [ "$1" = "-d" -o "$1" = "--debug" ] ; then
path_debug="$2"
fi
if [ "$1" = "-p" -o "$1" = "--path" ] ; then
path_AMConfig="$2"
fi
if [ "$3" = "-l" -o "$3" = "--log" ] ; then
path_log="$4"
fi
if [ "$3" = "-d" -o "$3" = "--debug" ] ; then
path_debug="$4"
fi
if [ "$3" = "-p" -o "$3" = "--path" ] ; then
path_AMConfig="$4"
fi
if [ "$5" = "-l" -o "$5" = "--log" ] ; then
path_log="$6"
fi
if [ "$5" = "-d" -o "$5" = "--debug" ] ; then
path_debug="$6"
fi
if [ "$5" = "-p" -o "$5" = "--path" ] ; then
path_AMConfig="$6"
fi
CLASSPATH=""
CLASSPATH="$CLASSPATH:lib/opendj-server-${opendj.server.version}.jar"
CLASSPATH="$CLASSPATH:lib/forgerock-util-${commons.forgerock-util.version}.jar"
CLASSPATH="$CLASSPATH:lib/json-20090211.jar"
CLASSPATH="$CLASSPATH:lib/xalan-2.7.1.jar"
CLASSPATH="$CLASSPATH:lib/xercesImpl-2.10.0.jar"
CLASSPATH="$CLASSPATH:lib/xml-apis-1.4.01.jar"
CLASSPATH="$CLASSPATH:lib/xmlsec-1.3.0.jar"
CLASSPATH="$CLASSPATH:lib/openam-core-${project.version}.jar"
CLASSPATH="$CLASSPATH:lib/openam-shared-${project.version}.jar"
CLASSPATH="$CLASSPATH:lib/openam-dtd-schema-${project.version}.jar"
CLASSPATH="$CLASSPATH:lib/openam-rest-${project.version}.jar"
CLASSPATH="$CLASSPATH:resources"
$JAVA_HOME/bin/java -D"load.config=yes" -D"help.print=$help_print" \
-D"path.AMConfig=$path_AMConfig" -D"path.debug=$path_debug" \
-D"path.log=$path_log" \
-cp "$CLASSPATH" \
com.sun.identity.tools.bundles.Main