a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller#!/bin/sh
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller#
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# Copyright 2013 ForgeRock, Inc.
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller#
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# The contents of this file are subject to the terms of the Common Development and
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# Distribution License (the License). You may not use this file except in compliance
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# with the License.
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller#
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# the specific language governing permission and limitations under the License.
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller#
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# When distributing Covered Software, include this CDDL Header Notice in each file
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# and include the License file at legal/CDDLv1.0.txt. If applicable, add the
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# following below the CDDL Header, with the fields enclosed by brackets []
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# replaced by your own identifying information:
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# "Portions copyright [year] [name of copyright owner]".
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller#
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# resolve links - $0 may be a softlink
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan MmillerPRG="$0"
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmillerwhile [ -h "$PRG" ]; do
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller ls=`ls -ld "$PRG"`
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller link=`expr "$ls" : '.*-> \(.*\)$'`
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller if expr "$link" : '/.*' > /dev/null; then
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller PRG="$link"
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller else
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller PRG=`dirname "$PRG"`/"$link"
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller fi
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmillerdone
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmillerecho "Executing $PRG..."
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller# Get standard environment variables
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan MmillerPRGDIR=`dirname "$PRG"`
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan MmillerOPENIDM_HOME=${OPENIDM_HOME:-`(cd "$PRGDIR"; pwd)`}
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmillerecho "Starting shell in $OPENIDM_HOME"
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller
71b5a79cb206bd5ea76ef474d5de495683a21e3aJim Mitchenerjava $JAVA_OPTS -classpath "$OPENIDM_HOME/bin/*:$OPENIDM_HOME/bundle/*" \
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller -Dopenidm.system.server.root="$OPENIDM_HOME" \
a4304c3b0aa2b23fc8e820616d5cd09d82f49927Brendan Mmiller org.forgerock.openidm.shell.impl.Main "$@"