Mark as bearer confirmation, not sender vouches
[java-idp.git] / tools / shib-tools.sh
1 #! /bin/bash
2
3 declare LOCATION
4 declare COMMAND
5 declare JAVACMD
6 declare LOCALCLASSPATH
7 declare LIBDIR
8
9 LOCATION=$0
10 LOCATION=${LOCATION%/*}
11
12 COMMAND=$0
13 COMMAND=${COMMAND##*/}
14
15 if [ -z "$JAVA_HOME" ] ; then
16   echo "ERROR: JAVA_HOME environment variable is not set."
17   exit
18 else
19   if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 
20     # IBM's JDK on AIX uses strange locations for the executables
21     JAVACMD=$JAVA_HOME/jre/sh/java
22   else
23     JAVACMD=$JAVA_HOME/bin/java
24   fi
25 fi
26
27 if [ ! -x "$JAVACMD" ] ; then
28   echo "Error: JAVA_HOME is not defined correctly."
29   echo "  We cannot execute $JAVACMD"
30   exit
31 fi
32
33 LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/classes.zip
34
35 # add in the dependency .jar files from the lib directory
36 LIBS=$LOCATION/../lib/*.jar
37 for i in $LIBS
38 do
39     # if the directory is empty, then it will return the input string
40     # this is stupid, so case for it
41     if [ "$i" != "${LIBS}" ] ; then
42         LOCALCLASSPATH=$LOCALCLASSPATH:"$i"
43     fi
44 done
45
46 case "$COMMAND" in
47   
48   aacli.sh)
49     "$JAVACMD" '-classpath' "$LOCALCLASSPATH" 'edu.internet2.middleware.shibboleth.common.attribute.AttributeAuthorityCLI' "$@"
50   ;;
51
52 esac