scripts/sql-dk.sh
author František Kučera <franta-hg@frantovo.cz>
Thu, 02 Jan 2014 20:30:53 +0100
branchv_0
changeset 117 a07f34410081
parent 114 125e3373d6e2
child 121 53a331cbc7b4
permissions -rwxr-xr-x
example-config.xml moved to xml dir
     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.rnc ] || ln -s /usr/share/doc/sql-dk/config.rnc ~/.sql-dk/config.rnc
     8 [ -f ~/.sql-dk/config.xsd ] || ln -s /usr/share/doc/sql-dk/config.xsd ~/.sql-dk/config.xsd
     9 
    10 [ -n "$JAR" ] || JAR="/usr/share/sql-dk/sql-dk.jar";
    11 
    12 MAIN_CLASS="info.globalcode.sql.dk.CLIStarter";
    13 CLASSPATH="$JAR:/usr/share/java/postgresql-jdbc4.jar";
    14 
    15 LOGGER="-Djava.util.logging.config.class=info.globalcode.sql.dk.logging.LoggerInitializer";
    16 # LOG_LEVEL="FINE"; # SEVERE, WARNING, INFO, FINE, FINER, FINEST, ALL
    17 [ -n "$LOG_LEVEL" ] && LOGGER_LEVEL="-Dinfo.globalcode.sql.dk.logging.LoggerInitializer.level=$LOG_LEVEL";
    18 
    19 java $LOGGER $LOGGER_LEVEL -cp $CLASSPATH $MAIN_CLASS "$@"