4 if [ ! -n "$JAVA_HOME" ] ; then
5 echo "Error: JAVA_HOME is not defined."
9 if [ ! -n "$JAVACMD" ] ; then
10 JAVACMD=$JAVA_HOME/bin/java
13 if [ ! -x "$JAVACMD" ] ; then
14 echo "Error: JAVA_HOME is not defined correctly."
15 echo "Cannot execute $JAVACMD"
20 ##Find the shibboleth components
22 if [ -n "$IDP_HOME" ] ; then
25 if [ -n "$SP_HOME" ] ; then
28 if [ ! -n "$SHIB_HOME" ] ; then
29 echo "Error: Neither IDP_HOME nor SP_HOME is defined."
33 ENDORSED=$SHIB_HOME/endorsed
35 if [ ! \( -f "$SHIB_HOME/lib/shib-util.jar" -a -r "$SHIB_HOME/lib/shib-util.jar" \) ] ; then
36 echo "Error: Cannot find the shibboleth jar (shib-util.jar)."
37 echo " If you downloaded the shibboleth source, you need to run \"ant build-util\""
41 ##Grab all the dependencies
42 if [ -n "$CLASSPATH" ] ; then
43 SHIB_UTIL_CLASSPATH=$CLASSPATH
46 DIRLIBS=${SHIB_HOME}/lib/*.jar
49 # if the directory is empty, then it will return the input string
50 # this is stupid, so case for it
51 if [ "$i" != "${DIRLIBS}" ] ; then
52 if [ -z "$SHIB_UTIL_CLASSPATH" ] ; then
53 SHIB_UTIL_CLASSPATH=$i
55 SHIB_UTIL_CLASSPATH="$i":$SHIB_UTIL_CLASSPATH
59 SHIB_UTIL_CLASSPATH=$SHIB_UTIL_CLASSPATH:"$SHIB_HOME"
62 $JAVACMD -Djava.endorsed.dirs="$ENDORSED" -cp $SHIB_UTIL_CLASSPATH edu.internet2.middleware.shibboleth.utils.MetadataTool "$@"