9fba71
#!/bin/bash
9fba71
9fba71
if [ -z "$JETTY_PID" ]
9fba71
then
9fba71
   export JETTY_PID=/dev/null
9fba71
fi
9fba71
9fba71
if [ -z "$JETTY_PORT" ]
9fba71
then
9fba71
   export JETTY_PORT=8088
9fba71
fi
9fba71
9fba71
export JETTY_HOME=/usr/share/jetty
9fba71
if [ -z "$JETTY_HOME" ] 
9fba71
then
9fba71
  JETTY_HOME_1=`dirname "$0"`
9fba71
  JETTY_HOME_1=`dirname "$JETTY_HOME_1"`
9fba71
  JETTY_HOME=${JETTY_HOME_1} 
9fba71
fi
9fba71
9fba71
cd $JETTY_HOME
9fba71
9fba71
# Try to create work directory if not exists
9fba71
if [ ! -d work ]; then
9fba71
    (umask 022 && mkdir -p "$(readlink -f work)")
9fba71
fi
9fba71
9fba71
exec /usr/bin/java -Djetty.class.path=/usr/share/java/commons-logging.jar -Djetty.port=$JETTY_PORT  -jar start.jar etc/jetty-logging.xml etc/jetty.xml 2>/dev/null &
9fba71
echo $! >$JETTY_PID
9fba71