Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
inc-meta/tools/xmlsectool-3.0.0/xmlsectool.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
49 lines (41 sloc)
1.18 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# See the Javadoc for the XMLSecTool main class for documentation | |
# of non-zero exit codes. | |
# | |
declare LOCATION | |
declare COMMAND | |
declare JAVACMD | |
declare LOCALCLASSPATH | |
declare LIBDIR | |
LOCATION=$0 | |
LOCATION=${LOCATION%/*} | |
if [ -z "$JAVA_HOME" ] ; then | |
echo "ERROR: JAVA_HOME environment variable is not set." | |
exit 8 | |
else | |
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | |
# IBM's JDK on AIX uses strange locations for the executables | |
JAVACMD=$JAVA_HOME/jre/sh/java | |
else | |
JAVACMD=$JAVA_HOME/bin/java | |
fi | |
fi | |
if [ ! -x "$JAVACMD" ] ; then | |
echo "Error: JAVA_HOME is not defined correctly." | |
echo " We cannot execute $JAVACMD" | |
exit 9 | |
fi | |
LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/classes.zip | |
# add in the dependency .jar files from the lib directory | |
LIBDIR=$LOCATION/lib | |
LIBS=$LIBDIR/*.jar | |
for i in $LIBS | |
do | |
# if the directory is empty, then it will return the input string | |
# this is stupid, so case for it | |
if [ "$i" != "${LIBS}" ] ; then | |
LOCALCLASSPATH=$LOCALCLASSPATH:"$i" | |
fi | |
done | |
"$JAVACMD" '-classpath' "$LOCALCLASSPATH" $JVMOPTS '-Dnet.shibboleth.tool.xmlsectool.XMLSecTool.home='"$LOCATION" 'net.shibboleth.tool.xmlsectool.XMLSecTool' "$@" |