Return-Path: Delivered-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Received: (qmail 40885 invoked from network); 26 Apr 2010 12:28:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Apr 2010 12:28:59 -0000 Received: (qmail 10110 invoked by uid 500); 26 Apr 2010 12:28:59 -0000 Delivered-To: apmail-incubator-connectors-commits-archive@incubator.apache.org Received: (qmail 10061 invoked by uid 500); 26 Apr 2010 12:28:59 -0000 Mailing-List: contact connectors-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-dev@incubator.apache.org Delivered-To: mailing list connectors-commits@incubator.apache.org Received: (qmail 10039 invoked by uid 99); 26 Apr 2010 12:28:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 12:28:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 12:28:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 783EF23888EC; Mon, 26 Apr 2010 12:28:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r938018 - /incubator/lcf/trunk/modules/framework/scripts/executecommand.sh Date: Mon, 26 Apr 2010 12:28:14 -0000 To: connectors-commits@incubator.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100426122814.783EF23888EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwright Date: Mon Apr 26 12:28:14 2010 New Revision: 938018 URL: http://svn.apache.org/viewvc?rev=938018&view=rev Log: First cut of executecommand unix shell script. Added: incubator/lcf/trunk/modules/framework/scripts/executecommand.sh Added: incubator/lcf/trunk/modules/framework/scripts/executecommand.sh URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/scripts/executecommand.sh?rev=938018&view=auto ============================================================================== --- incubator/lcf/trunk/modules/framework/scripts/executecommand.sh (added) +++ incubator/lcf/trunk/modules/framework/scripts/executecommand.sh Mon Apr 26 12:28:14 2010 @@ -0,0 +1,35 @@ +#!/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