scripts/sql-dk.sh
author František Kučera <franta-hg@frantovo.cz>
Thu, 02 Jan 2014 21:26:50 +0100
branchv_0
changeset 121 53a331cbc7b4
parent 114 125e3373d6e2
child 122 0c284726a77d
permissions -rwxr-xr-x
package and copy XSLT
     1 #!/bin/bash
     2 
     3 if [ -f ~/.sql-dk/environment.sh ]; then # .sql-dk must match with DIR in Constants.java
     4     . ~/.sql-dk/environment.sh
     5 fi
     6 
     7 [ -f ~/.sql-dk/config.xsd ] || ln -s /usr/share/doc/sql-dk/config.xsd ~/.sql-dk/config.xsd
     8 [ -f ~/.sql-dk/config.rnc ] || ln -s /usr/share/doc/sql-dk/config.rnc ~/.sql-dk/config.rnc
     9 [ -f ~/.sql-dk/config.xsl ] || cp /usr/share/doc/sql-dk/config.xsl ~/.sql-dk/config.xsl # might not work in www browser if just symlinked
    10 
    11 [ -n "$JAR" ] || JAR="/usr/share/sql-dk/sql-dk.jar";
    12 
    13 MAIN_CLASS="info.globalcode.sql.dk.CLIStarter";
    14 CLASSPATH="$JAR:/usr/share/java/postgresql-jdbc4.jar";
    15 
    16 LOGGER="-Djava.util.logging.config.class=info.globalcode.sql.dk.logging.LoggerInitializer";
    17 # LOG_LEVEL="FINE"; # SEVERE, WARNING, INFO, FINE, FINER, FINEST, ALL
    18 [ -n "$LOG_LEVEL" ] && LOGGER_LEVEL="-Dinfo.globalcode.sql.dk.logging.LoggerInitializer.level=$LOG_LEVEL";
    19 
    20 java $LOGGER $LOGGER_LEVEL -cp $CLASSPATH $MAIN_CLASS "$@"