Wrapper script for resolver test program.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 17 Jul 2003 21:07:34 +0000 (21:07 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 17 Jul 2003 21:07:34 +0000 (21:07 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@678 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

bin/resolvertest [new file with mode: 0755]

diff --git a/bin/resolvertest b/bin/resolvertest
new file mode 100755 (executable)
index 0000000..5ec4404
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+##We need a JVM
+if [ ! -n "$JAVA_HOME" ] ; then
+  echo "Error: JAVA_HOME is not defined."
+  exit
+fi
+
+if [ ! -n "$JAVACMD" ] ; then
+  JAVACMD=$JAVA_HOME/bin/java
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "Cannot execute $JAVACMD"
+  exit
+fi
+
+
+##Find the shibboleth components
+if [ ! -n "$SHIB_HOME" ] ; then
+  echo "Error: SHIB_HOME is not defined."
+  exit
+fi
+
+if [ ! \( -f "$SHIB_HOME/lib/shib-util.jar" -a -r "$SHIB_HOME/lib/shib-util.jar" \) ] ; then
+  echo "Error: Cannot find the shibboleth jar (shib-util.jar)."
+  echo "       If you downloaded the shibboleth source, you need to run \"ant build-util\""
+  exit
+fi
+
+ENDORSED=$SHIB_HOME/endorsed/
+
+##Grab all the dependencies
+if [ -n "$CLASSPATH" ] ; then
+  SHIB_UTIL_CLASSPATH=$CLASSPATH
+fi
+
+DIRLIBS=${SHIB_HOME}/lib/*.jar
+for i in ${DIRLIBS}
+do
+    # if the directory is empty, then it will return the input string
+    # this is stupid, so case for it
+    if [ "$i" != "${DIRLIBS}" ] ; then
+      if [ -z "$SHIB_UTIL_CLASSPATH" ] ; then
+        SHIB_UTIL_CLASSPATH=$i
+      else
+        SHIB_UTIL_CLASSPATH="$i":$SHIB_UTIL_CLASSPATH
+      fi
+    fi
+done
+
+
+##Here we go
+$JAVACMD -Djava.endorsed.dirs="$ENDORSED" -classpath $SHIB_UTIL_CLASSPATH  edu.internet2.middleware.shibboleth.utils.ResolverTest "$@"