#!/bin/sh
#
# Startup script for Jetty with systemd
#

set -e

# Load the service settings
. /etc/default/jetty12

# Find the Java runtime and set JAVA_HOME
. /usr/libexec/jetty12/jetty-locate-java.sh

# Start Tomcat
cd $CATALINA_BASE && exec $CATALINA_HOME/bin/catalina.sh run

cd $JETTY_BASE && $JAVA_HOME/bin/java $JAVA_OPTIONS -jar $JETTY_HOME/start.jar -Djetty.base=$JETTY_BASE $JETTY_ARGS
