#!/bin/bash -e

#Make sure environment variables are properly set
if [ -e $JAVA_HOME/bin/java ] ; then
    if [ -f $LCF_HOME/properties.ini ] ; then
    
        # Build the classpath
        CLASSPATH=""
        for filename in $(ls -1 "$LCF_HOME/processes/jar") ; do
            if [ -n "$CLASSPATH" ] ; then
                CLASSPATH="$CLASSPATH":"$LCF_HOME"/processes/jar/"$filename"
            else
                CLASSPATH="$LCF_HOME"/processes/jar/"$filename"
            fi
        done
        
        # Build the defines
        DEFINES=""
        for filename in $(ls -1 "$LCF_HOME/processes/define") ; do
            DEFINEVAR=-D"$filename"=$(cat "$LCF_HOME/processes/define/"$filename")
            DEFINES="$DEFINES $DEFINEVAR"
        done
        
        "$JAVA_HOME/bin/java" "$DEFINES" --classpath "$CLASSPATH" "$@"
        exit $?
        
    else
        echo "Environment variable LCF_HOME is not properly set." 1>&2
        exit 1
    fi
    
else
    echo "Environment variable JAVA_HOME is not properly set." 1>&2
    exit 1
fi

#!/bin/bash -e

#Make sure environment variables are properly set
if [ -e "$JAVA_HOME"/bin/java ] ; then
    if [ -f "$LCF_HOME"/properties.ini ] ; then
    
        # Build the classpath
        CLASSPATH=""
        for filename in $(ls -1 "$LCF_HOME/processes/jar") ; do
            if [ -n "$CLASSPATH" ] ; then
                CLASSPATH="$CLASSPATH":"$LCF_HOME"/processes/jar/"$filename"
            else
                CLASSPATH="$LCF_HOME"/processes/jar/"$filename"
            fi
        done
        
        # Build the defines
        DEFINES=""
        if [ -e "$LCF_HOME/processes/define" ] ; then
            for filename in $(ls -1 "$LCF_HOME/processes/define") ; do
                DEFINEVAR=-D"$filename"=$(cat "$LCF_HOME/processes/define/"$filename")
                DEFINES="$DEFINES $DEFINEVAR"
            done
        fi
        
        "$JAVA_HOME/bin/java" "$DEFINES" --classpath "$CLASSPATH" "$@"
        exit $?
        
    else
        echo "Environment variable LCF_HOME is not properly set." 1>&2
        exit 1
    fi
    
else
    echo "Environment variable JAVA_HOME is not properly set." 1>&2
    exit 1
fi

Correct problems found by a user when they tried to kick this script off.
Correct problems found by a user when they tried to kick this script off.

git-svn-id: 0503cfb7d358eaa9bd718f348f448f10022ea703@938269 13f79535-47bb-0310-9956-ffa450edef68
