#!/bin/sh

# Java heap size, in megabytes
JAVA_HEAP_SIZE=512

# determine the java command to be run
# Find a java installation.
if [ -z "$JAVA_HOME" ]; then
	echo "Warning: \$JAVA_HOME environment variable not set! Consider setting it."
	echo "          Attempting to locate java..."
	j=`which java 2>/dev/null`
	if [ -z "$j" ]; then
		echo "Failed to locate the java virtual machine! Exiting..."
		exit 1
	else
		echo "Found a virtual machine at: $j..."
		JAVA="$j"
	fi
else
	JAVA="$JAVA_HOME/bin/java"
fi

BASE_PATH=/usr/share/executequery
exec $JAVA "-javaagent:$BASE_PATH/agent.jar=ExecuteQuery" -mx${JAVA_HEAP_SIZE}m -jar "$BASE_PATH/eq.jar" &


