Start H2 Db as daemon

Here my script to start H2 db as daemon under linux Os.
Please note param “-baseDir $HOME” this means that default storage path is the home of the user that start db,
change variable with absolute path to prevent new Db creation with wrong users.

 
#!/bin/sh

cd `dirname ${0}`/..

case $1 in
  help)
    java -cp <h2Path>/h2-*.jar org.h2.tools.Server -?
  ;;

  start)
    java -cp <h2Path>/h2-*.jar org.h2.tools.Server -tcp -web -baseDir $HOME &
  ;;

  stop)
    java -cp <h2Path>/h2-*.jar org.h2.tools.Server -tcpShutdown "tcp://localhost"
  ;;

  *)
    echo "Usage ${0} (help|start|stop)"
  ;;
esac