#!/bin/bash -x

echo "logging with /home/jbf/tmp/mylogging.properties..."
echo "see code where arg 2 can trigger remote debugging."
echo "arg 2=$2"

if [ "$2" = "_test500_009.png"  ]; then
    echo "Java will pause waiting for debugger on port 12345"
    DEBUG="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=12345,suspend=y"
else
    DEBUG=""
fi

p=/home/Dragon/.hudson/jobs/autoplot-release/workspace/autoplot/VirboAutoplot/dist/
/local/java/bin/java $DEBUG -Xmx2000M -cp $p/AutoplotStable.jar:$p/AutoplotVolatile.jar -Djava.util.logging.SimpleFormatter.format='%4$s: %5$s [%1$tc]%n' -Djava.util.logging.config.file=/home/jbf/autoplot/test/mylogging.properties -Djava.awt.headless=true org.virbo.autoplot.AutoplotServer --vap=file:$1 --outfile=$2

status=$?
echo "status=$status"

exit $status 
