svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.framework / org.gvsig.andami / src / main / resources-application / tools / h2sql @ 45136
History | View | Annotate | Download (2.05 KB)
1 | 45136 | jjdelcerro | #!/bin/bash |
---|---|---|---|
2 | # |
||
3 | # gvSIG. Desktop Geographic Information System. |
||
4 | # |
||
5 | # Copyright (C) 2007-2020 gvSIG Association. |
||
6 | # |
||
7 | # This program is free software; you can redistribute it and/or |
||
8 | # modify it under the terms of the GNU General Public License |
||
9 | # as published by the Free Software Foundation; either version 3 |
||
10 | # of the License, or (at your option) any later version. |
||
11 | # |
||
12 | # This program is distributed in the hope that it will be useful, |
||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | # GNU General Public License for more details. |
||
16 | # |
||
17 | # You should have received a copy of the GNU General Public License |
||
18 | # along with this program; if not, write to the Free Software |
||
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
||
20 | # MA 02110-1301, USA. |
||
21 | # |
||
22 | # For any additional information, do not hesitate to contact us |
||
23 | # at info AT gvsig.com, or visit our website www.gvsig.com. |
||
24 | # |
||
25 | |||
26 | # h2sql |
||
27 | |||
28 | ARGS="$@" # Can't use ${@/ , use ${ARGS/ instead |
||
29 | |||
30 | |||
31 | # Go into the gvSIG installation folder, just in case |
||
32 | x=$(dirname "$0") |
||
33 | cd "$x" |
||
34 | cd .. |
||
35 | |||
36 | GVSIG_INSTALL_FOLDER="$PWD" |
||
37 | GVSIG_CLASSPATH="" |
||
38 | CPSEP=":" |
||
39 | |||
40 | add_classpath() { |
||
41 | GVSIG_CLASSPATH="$GVSIG_CLASSPATH${CPSEP}$1" |
||
42 | } |
||
43 | |||
44 | |||
45 | # Load gvSIG Andami jars and dependencies for the classpath |
||
46 | for i in "$GVSIG_INSTALL_FOLDER/lib/"*.jar ; do |
||
47 | if [ "$i" != "$GVSIG_INSTALL_FOLDER/lib/*.jar" -a "$i" != "" ]; then |
||
48 | add_classpath "$i" |
||
49 | fi |
||
50 | done |
||
51 | for i in "$GVSIG_INSTALL_FOLDER/lib/"*.zip ; do |
||
52 | if [ "$i" != "$GVSIG_INSTALL_FOLDER/lib/*.zip" -a "$i" != "" ]; then |
||
53 | add_classpath "$i" |
||
54 | fi |
||
55 | done |
||
56 | |||
57 | # Load H2 jars in the classpath |
||
58 | for i in "$GVSIG_INSTALL_FOLDER/gvSIG/extensiones/org.gvsig.h2spatial.app.mainplugin/lib/"*.jar ; do |
||
59 | if [ "$i" != "$GVSIG_INSTALL_FOLDER/gvSIG/extensiones/org.gvsig.h2spatial.app.mainplugin/lib/*.jar" -a "$i" != "" ]; then |
||
60 | add_classpath "$i" |
||
61 | fi |
||
62 | done |
||
63 | |||
64 | if test -e "$GVSIG_INSTALL_FOLDER/gvSIG/extensiones/jre/bin/java" ; then |
||
65 | JAVA="$GVSIG_INSTALL_FOLDER/gvSIG/extensiones/jre/bin/java" |
||
66 | else |
||
67 | JAVA="java" |
||
68 | fi |
||
69 | exec "$JAVA" -cp "$GVSIG_CLASSPATH" org.h2.tools.Shell $ARGS |