Clean up unused variables reported by user.
[java-idp.git] / bin / extkeytool
1 #!/bin/sh
2
3 ##We need a JVM
4 if [ ! -n "$JAVA_HOME" ] ; then
5   echo "Error: JAVA_HOME is not defined."
6   exit
7 fi
8
9 if [ ! -n "$JAVACMD" ] ; then
10   JAVACMD=$JAVA_HOME/bin/java
11 fi
12
13 if [ ! -x "$JAVACMD" ] ; then
14   echo "Error: JAVA_HOME is not defined correctly."
15   echo "Cannot execute $JAVACMD"
16   exit
17 fi
18
19
20 ##Find the shibboleth components
21 if [ ! -n "$SHIB_HOME" ] ; then
22   echo "Error: SHIB_HOME is not defined."
23   exit
24 fi
25
26 ## Where log4j config file is
27 LOG_CONFIG=$SHIB_HOME/conf/log4j.properties
28
29 if [ ! \( -f "$SHIB_HOME/lib/shib-util.jar" -a -r "$SHIB_HOME/lib/shib-util.jar" \) ] ; then
30   echo "Error: Cannot find the shibboleth jar (shib-util.jar)."
31   echo "       If you downloaded the shibboleth source, you need to run \"ant build-util\""
32   exit
33 fi
34
35
36 ##Grab all the dependencies
37 if [ -n "$CLASSPATH" ] ; then
38   SHIB_UTIL_CLASSPATH=$CLASSPATH
39 fi
40
41 DIRLIBS=${SHIB_HOME}/lib/*.jar
42 for i in ${DIRLIBS}
43 do
44     # if the directory is empty, then it will return the input string
45     # this is stupid, so case for it
46     if [ "$i" != "${DIRLIBS}" ] ; then
47       if [ -z "$SHIB_UTIL_CLASSPATH" ] ; then
48         SHIB_UTIL_CLASSPATH=$i
49       else
50         SHIB_UTIL_CLASSPATH="$i":$SHIB_UTIL_CLASSPATH
51       fi
52     fi
53 done
54 SHIB_UTIL_CLASSPATH=$SHIB_UTIL_CLASSPATH:"$SHIB_HOME"
55
56 ##Here we go
57 $JAVACMD -Dlog4j.configuration="$LOG_CONFIG" -cp $SHIB_UTIL_CLASSPATH  edu.internet2.middleware.shibboleth.utils.ExtKeyTool "$@"