#!/bin/sh
#
# runserver.sh
#
# Script to start the Jetty server hosting the SVG Tiny 1.2 test suite.
#
# $Id: runserver.sh,v 1.1 2007/10/12 07:32:40 cmccorma Exp $

if [ ! -x "$JAVA_HOME/bin/java" ]; then
  echo "Ensure \$JAVA_HOME is set to the directory your JRE is installed in."
  exit 1
fi

if [ ".$1" = .-h -o ".$1" = .--help ]; then
  echo "Usage: $0 [port]"
  echo "Starts a web server on localhost, listening on port number 'port', that"
  echo "hosts the SVG Tiny 1.2 test suite.  The port number defaults to 8080."
  exit 1
fi

if [ .$1 = . ]; then
  PORT=8080
else
  PORT="$1"
fi

cd server && "$JAVA_HOME/bin/java" -Djetty.port="$PORT" -classpath lib/jetty-6.1.5.jar:lib/servlet-api-2.5-6.1.5.jar:lib/jetty-util-6.1.5.jar:lib/start.jar org.mortbay.start.Main jetty.xml

