setup revision b91860b6092997623ef4afe19c2abddbe27dc087
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#!/bin/sh
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# The contents of this file are subject to the terms
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# of the Common Development and Distribution License
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# (the License). You may not use this file except in
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# compliance with the License.
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# You can obtain a copy of the License at
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# https://opensso.dev.java.net/public/CDDLv1.0.html or
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# opensso/legal/CDDLv1.0.txt
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# See the License for the specific language governing
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# permission and limitations under the License.
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# When distributing Covered Code, include this CDDL
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# Header Notice in each file and include the License file
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# at opensso/legal/CDDLv1.0.txt.
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# If applicable, add the following below the CDDL Header,
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# with the fields enclosed by brackets [] replaced by
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# your own identifying information:
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANG# "Portions Copyrighted [year] [name of copyright owner]"
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#
06db247c678f0e3956535e8a6dec31d6c2108827raghuram# $Id: setup,v 1.11 2009/01/28 05:34:46 ww203982 Exp $
06db247c678f0e3956535e8a6dec31d6c2108827raghuram#
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ -z "${JAVA_HOME}" ]; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram echo "Please define JAVA_HOME environment variable before running this program"
06db247c678f0e3956535e8a6dec31d6c2108827raghuram echo "setup program will use the JVM defined in JAVA_HOME for all the CLI tools"
06db247c678f0e3956535e8a6dec31d6c2108827raghuram exit 1
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ ! -x "$JAVA_HOME"/bin/java ]; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram echo "The defined JAVA_HOME environment variable is not correct"
06db247c678f0e3956535e8a6dec31d6c2108827raghuram echo "setup program will use the JVM defined in JAVA_HOME for all the CLI tools"
06db247c678f0e3956535e8a6dec31d6c2108827raghuram exit 1
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
06db247c678f0e3956535e8a6dec31d6c2108827raghuramAWK=`which awk`
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ -z $AWK ]; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram echo "setup fails because awk is not found"
06db247c678f0e3956535e8a6dec31d6c2108827raghuram exit 1
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
06db247c678f0e3956535e8a6dec31d6c2108827raghuramJAVA_VER=`${JAVA_HOME}/bin/java -version 2>&1 | $AWK -F'"' '{print $2}'`
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
06db247c678f0e3956535e8a6dec31d6c2108827raghuramcase $JAVA_VER in
06db247c678f0e3956535e8a6dec31d6c2108827raghuram1.0* | 1.1* | 1.2* | 1.3*)
06db247c678f0e3956535e8a6dec31d6c2108827raghuram echo "This program is designed to work with 1.4 or newer JRE."
06db247c678f0e3956535e8a6dec31d6c2108827raghuram exit 0
06db247c678f0e3956535e8a6dec31d6c2108827raghuram ;;
06db247c678f0e3956535e8a6dec31d6c2108827raghuramesac
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$1" = "-h" -o "$1" = "--help" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram help_print=yes
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$1" = "-l" -o "$1" = "--log" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_log="$2"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$1" = "-d" -o "$1" = "--debug" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_debug="$2"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$1" = "-p" -o "$1" = "--path" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_AMConfig="$2"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$3" = "-l" -o "$3" = "--log" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_log="$4"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$3" = "-d" -o "$3" = "--debug" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_debug="$4"
c1c61f44e88f4c8c155272ee56d868043146096asbfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$3" = "-p" -o "$3" = "--path" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_AMConfig="$4"
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANGfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuramif [ "$5" = "-l" -o "$5" = "--log" ] ; then
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANG path_log="$6"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANGif [ "$5" = "-d" -o "$5" = "--debug" ] ; then
06db247c678f0e3956535e8a6dec31d6c2108827raghuram path_debug="$6"
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANGfi
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANGif [ "$5" = "-p" -o "$5" = "--path" ] ; then
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANG path_AMConfig="$6"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramfi
06db247c678f0e3956535e8a6dec31d6c2108827raghuram
6f09f0fef8e4582cfa771d87fe2a1f777bfb5cf0WENTAO YANGCLASSPATH=""
06db247c678f0e3956535e8a6dec31d6c2108827raghuramCLASSPATH="lib/openam-distribution-amadmsetup-10.1.0-SNAPSHOT.jar"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramCLASSPATH="${CLASSPATH}:lib/opendj-server-2.4.6-SNAPSHOT.jar"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramCLASSPATH="${CLASSPATH}:lib/json-20090211.jar"
da14cebe459d3275048785f25bd869cb09b5307fEric ChengCLASSPATH="${CLASSPATH}:lib/xalan-2.7.1.jar"
c1c61f44e88f4c8c155272ee56d868043146096asbCLASSPATH="${CLASSPATH}:lib/xercesImpl-2.10.0.jar"
06db247c678f0e3956535e8a6dec31d6c2108827raghuramCLASSPATH="${CLASSPATH}:lib/xml-apis-1.4.01.jar"
c1c61f44e88f4c8c155272ee56d868043146096asbCLASSPATH="${CLASSPATH}:lib/xmlsec-1.3.0.jar"
678453a8ed49104d8adad58f3ba591bdc39883e8speerCLASSPATH="${CLASSPATH}:lib/openam-core-10.1.0-SNAPSHOT.jar"
cdfc78ad277d82b1080e7c86213063d1b73e7789raghuramCLASSPATH="${CLASSPATH}:lib/openam-shared-10.1.0-SNAPSHOT.jar"
7b1f684a14f99a2b9b1b2561f484ff648eff6d9bSriharsha BasavapatnaCLASSPATH="${CLASSPATH}:lib/openam-dtd-schema-10.1.0-SNAPSHOT.jar"
7b1f684a14f99a2b9b1b2561f484ff648eff6d9bSriharsha BasavapatnaCLASSPATH="${CLASSPATH}:lib/openam-rest-10.1.0-SNAPSHOT.jar"
1107ea9346159bcc8ea154084897667347c4e6d5Sriharsha BasavapatnaCLASSPATH="${CLASSPATH}:resources"
1107ea9346159bcc8ea154084897667347c4e6d5Sriharsha Basavapatna
06db247c678f0e3956535e8a6dec31d6c2108827raghuram${JAVA_HOME}/bin/java -D"load.config=yes" -D"help.print=${help_print}" \
06db247c678f0e3956535e8a6dec31d6c2108827raghuram -D"path.AMConfig=${path_AMConfig}" -D"path.debug=${path_debug}" \
06db247c678f0e3956535e8a6dec31d6c2108827raghuram -D"path.log=${path_log}" \
06db247c678f0e3956535e8a6dec31d6c2108827raghuram -cp "${CLASSPATH}" \
06db247c678f0e3956535e8a6dec31d6c2108827raghuram com.sun.identity.tools.bundles.Main
06db247c678f0e3956535e8a6dec31d6c2108827raghuram