franta-hg@85: #!/bin/bash franta-hg@85: franta-hg@122: # include user-defined overrides and customization franta-hg@102: if [ -f ~/.sql-dk/environment.sh ]; then # .sql-dk must match with DIR in Constants.java franta-hg@150: . ~/.sql-dk/environment.sh franta-hg@150: else franta-hg@150: mkdir -p ~/.sql-dk/ franta-hg@150: # link/copy support files for configuration: franta-hg@188: [ -f ~/.sql-dk/environment.sh ] || touch ~/.sql-dk/environment.sh franta-hg@150: [ -f ~/.sql-dk/config.xsd ] || ln -s /usr/share/doc/sql-dk/config.xsd ~/.sql-dk/config.xsd franta-hg@150: [ -f ~/.sql-dk/config.rnc ] || ln -s /usr/share/doc/sql-dk/config.rnc ~/.sql-dk/config.rnc franta-hg@150: [ -f ~/.sql-dk/config.xsl ] || gunzip < /usr/share/doc/sql-dk/config.xsl.gz > ~/.sql-dk/config.xsl # might not work in www browser if just symlinked franta-hg@102: fi franta-hg@102: franta-hg@122: # Standard JDBC drivers franta-hg@122: [ -n "$STANDARD_JDBC" ] || STANDARD_JDBC=( franta-hg@122: "/usr/share/java/postgresql-jdbc4.jar" franta-hg@122: "/usr/share/java/mysql.jar" franta-hg@122: ); franta-hg@122: franta-hg@122: # Additional JDBC drivers might be specified in CUSTOM_JDBC array franta-hg@122: # Plugins (formatters etc.) might be specified in PLUGINS array franta-hg@122: franta-hg@122: # JAR containing SQL-DK application franta-hg@111: [ -n "$JAR" ] || JAR="/usr/share/sql-dk/sql-dk.jar"; franta-hg@85: franta-hg@122: CLASS_PATH="$JAR"; franta-hg@122: franta-hg@122: for e in "${STANDARD_JDBC[@]}" "${CUSTOM_JDBC[@]}" "${PLUGINS[@]}"; do franta-hg@122: CLASS_PATH="$CLASS_PATH:$e"; franta-hg@122: done franta-hg@122: franta-hg@122: franta-hg@85: MAIN_CLASS="info.globalcode.sql.dk.CLIStarter"; franta-hg@85: franta-hg@85: LOGGER="-Djava.util.logging.config.class=info.globalcode.sql.dk.logging.LoggerInitializer"; franta-hg@85: [ -n "$LOG_LEVEL" ] && LOGGER_LEVEL="-Dinfo.globalcode.sql.dk.logging.LoggerInitializer.level=$LOG_LEVEL"; franta-hg@85: franta-hg@199: java "${JAVA_OPTIONS[@]}" $LOGGER $LOGGER_LEVEL -cp "$CLASS_PATH" $MAIN_CLASS "$@"