#!/usr/bin/env bash H2_JAR=`ls ${JBOSS_HOME}/modules/system/layers/base/com/h2database/h2/main/h2-*.jar` print_help() { echo "$0 start|stop" echo "requires SILVERPEAS_HOME and JBOSS_HOME to be set" } case "$1" in start) echo "Start H2 database..." exec java -classpath "$H2_JAR" org.h2.tools.Server -tcp -baseDir "$SILVERPEAS_HOME/h2" & ;; stop) echo "Stop H2 database..." exec java -classpath "$H2_JAR" org.h2.tools.Server -tcpShutdown tcp://localhost:9092 ;; -h) print_help ;; *) print_help exit 1 esac