#!/bin/sh
#
# Start Script for Schema Spy
# ---------------------------
#
# Written by:  Marco Antonio Frias B. <marcofrias@linuxpackages.net>
#
# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
  echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
  echo "At least one of these environment variable is needed to run this program"
  exit 1
fi

if [ -z "$JRE_HOME" ]; then
  JRE_HOME="$JAVA_HOME"
fi

# Set standard commands for invoking java
RUNJAVA="$JRE_HOME"/bin/java

# Set full path to schemaspy home directory
SCHEMASPY_HOME=/usr/share/schemaspy

# Execute
$RUNJAVA -jar "$SCHEMASPY_HOME"/schemaSpy_4.1.1.jar "$@"
