scripts/sql-dk.sh
author František Kučera <franta-hg@frantovo.cz>
Thu, 02 Jan 2014 20:00:17 +0100
branchv_0
changeset 114 125e3373d6e2
parent 111 259c0c64321b
child 121 53a331cbc7b4
permissions -rwxr-xr-x
Starter script: create symlinks for XSD and Relax NG XML schemas
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
#!/bin/bash
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
102
ff47349e24bf Load ~/.sql-dk/environment.sh if exists
František Kučera <franta-hg@frantovo.cz>
parents: 85
diff changeset
     3
if [ -f ~/.sql-dk/environment.sh ]; then # .sql-dk must match with DIR in Constants.java
ff47349e24bf Load ~/.sql-dk/environment.sh if exists
František Kučera <franta-hg@frantovo.cz>
parents: 85
diff changeset
     4
    . ~/.sql-dk/environment.sh
ff47349e24bf Load ~/.sql-dk/environment.sh if exists
František Kučera <franta-hg@frantovo.cz>
parents: 85
diff changeset
     5
fi
ff47349e24bf Load ~/.sql-dk/environment.sh if exists
František Kučera <franta-hg@frantovo.cz>
parents: 85
diff changeset
     6
114
125e3373d6e2 Starter script: create symlinks for XSD and Relax NG XML schemas
František Kučera <franta-hg@frantovo.cz>
parents: 111
diff changeset
     7
[ -f ~/.sql-dk/config.rnc ] || ln -s /usr/share/doc/sql-dk/config.rnc ~/.sql-dk/config.rnc
125e3373d6e2 Starter script: create symlinks for XSD and Relax NG XML schemas
František Kučera <franta-hg@frantovo.cz>
parents: 111
diff changeset
     8
[ -f ~/.sql-dk/config.xsd ] || ln -s /usr/share/doc/sql-dk/config.xsd ~/.sql-dk/config.xsd
125e3373d6e2 Starter script: create symlinks for XSD and Relax NG XML schemas
František Kučera <franta-hg@frantovo.cz>
parents: 111
diff changeset
     9
111
259c0c64321b Starter script: systemwide JAR location (user can override it in environment.sh by JAR variable)
František Kučera <franta-hg@frantovo.cz>
parents: 102
diff changeset
    10
[ -n "$JAR" ] || JAR="/usr/share/sql-dk/sql-dk.jar";
85
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
MAIN_CLASS="info.globalcode.sql.dk.CLIStarter";
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
CLASSPATH="$JAR:/usr/share/java/postgresql-jdbc4.jar";
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
LOGGER="-Djava.util.logging.config.class=info.globalcode.sql.dk.logging.LoggerInitializer";
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
# LOG_LEVEL="FINE"; # SEVERE, WARNING, INFO, FINE, FINER, FINEST, ALL
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
[ -n "$LOG_LEVEL" ] && LOGGER_LEVEL="-Dinfo.globalcode.sql.dk.logging.LoggerInitializer.level=$LOG_LEVEL";
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
b9b4e95240e1 sql-dk startup shell script
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
java $LOGGER $LOGGER_LEVEL -cp $CLASSPATH $MAIN_CLASS "$@"