1 | #!/bin/bash
|
---|
2 |
|
---|
3 | if [ ! -z $explang ] ; then
|
---|
4 | explang=en
|
---|
5 | fi
|
---|
6 |
|
---|
7 | if [ "x$PROGNAME" = "x" ] ; then
|
---|
8 | if [ "$explang" = "es" ]; then
|
---|
9 | PROGNAME="Navegador Expeditee"
|
---|
10 | elif [ "$explang" = "fr" ]; then
|
---|
11 | PROGNAME="Navigateur Expeditee"
|
---|
12 | elif [ "$explang" = "ru" ]; then
|
---|
13 | PROGNAME="Браузер Expeditee"
|
---|
14 | else
|
---|
15 | PROGNAME="Expeditee Browser"
|
---|
16 | fi
|
---|
17 | fi
|
---|
18 |
|
---|
19 | if [ "x$PROGABBR" = "x" ] ; then
|
---|
20 | PROGABBR="Expeditee"
|
---|
21 | fi
|
---|
22 |
|
---|
23 | if [ "x$PROGNAME_EN" = "x" ] ; then
|
---|
24 | PROGNAME_EN="Expeditee Browser"
|
---|
25 | fi
|
---|
26 |
|
---|
27 | if [ "x$EXPMODE" = "x" ] ; then
|
---|
28 | EXPMODE="local"
|
---|
29 | fi
|
---|
30 |
|
---|
31 | echo
|
---|
32 | if [ "$explang" = "es" ]; then
|
---|
33 | echo "Interfaz de la $PROGNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
34 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
35 | echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
|
---|
36 | echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
|
---|
37 | echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
|
---|
38 | elif [ "$explang" = "fr" ]; then
|
---|
39 | echo "Interface du $PROGNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
40 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
41 | echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
|
---|
42 | echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
|
---|
43 | elif [ "$explang" = "ru" ]; then
|
---|
44 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
45 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
46 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
47 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
48 | else
|
---|
49 | echo "$PROGNAME ($PROGABBR)"
|
---|
50 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
51 | echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
|
---|
52 | echo "This is free software, and you are welcome to redistribute it"
|
---|
53 | fi
|
---|
54 | echo
|
---|
55 |
|
---|
56 | ## -------- Run the Expeditee Browser --------
|
---|
57 | # This script is designed to be run from its own directory (instead of whichever directory it may be called from)
|
---|
58 | # => Work out where that is, and 'cd' there
|
---|
59 | thisdir="`dirname \"$0\"`"
|
---|
60 | thisdir="`cd \"$thisdir\" && pwd`"
|
---|
61 | cd "$thisdir"
|
---|
62 |
|
---|
63 |
|
---|
64 | ## ---- Determine EXPEDITEE_HOME ----
|
---|
65 | # need to source a script in order to inherit the env vars it has set
|
---|
66 | # Exit on error code (non-zero)
|
---|
67 | exit_status=0
|
---|
68 | source ./findexpeditee.sh
|
---|
69 | exit_status=$?
|
---|
70 | if [ "$exit_status" -eq 1 ]; then
|
---|
71 | exit 1;
|
---|
72 | fi
|
---|
73 |
|
---|
74 | ## ---- Check Java ----
|
---|
75 | # call the script with source, so that we have the variables it sets ($javapath)
|
---|
76 | exit_status=0
|
---|
77 | source ./findjava.sh "$explang" "$PROGNAME"
|
---|
78 | exit_status=$?
|
---|
79 | if [ "$exit_status" -eq 1 ]; then
|
---|
80 | exit 1;
|
---|
81 | fi
|
---|
82 |
|
---|
83 | ## ---- Finally, run Expeditee ----
|
---|
84 | if [ "$explang" = "es" ]; then
|
---|
85 | echo "Ejecutando la Interfaz de la $PROGNAME..."
|
---|
86 | elif [ "$explang" = "fr" ]; then
|
---|
87 | echo "Exécution de $PROGNAME..."
|
---|
88 | elif [ "$explang" = "ru" ]; then
|
---|
89 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
|
---|
90 | else
|
---|
91 | echo "Running the $PROGNAME..."
|
---|
92 | fi
|
---|
93 |
|
---|
94 | # basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
|
---|
95 | #basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg"
|
---|
96 | stop_gli=0
|
---|
97 | while [ "$stop_gli" = "0" ] ; do
|
---|
98 |
|
---|
99 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
100 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
101 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
102 | # -verbose:gc To set garbage collection messages
|
---|
103 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
104 | # -Xprof Function call profiling
|
---|
105 | # -Xloggc:<file> Write garbage collection log
|
---|
106 |
|
---|
107 | # -Xdock:name To set the name of the app in the MacOS Dock bar
|
---|
108 | # -Xdock:icon Path to the MacOS Doc icon (not necessary for GS)
|
---|
109 | custom_vm_args=""
|
---|
110 | if [ "$GSDLOS" = "darwin" ]; then
|
---|
111 | custom_vm_args="-Xdock:name=$PROGABBR"
|
---|
112 | fi
|
---|
113 |
|
---|
114 | exit_status=0
|
---|
115 | if [ "$_version" -eq 2 ]; then
|
---|
116 | # GS2 webLib
|
---|
117 | if [ "$PROGABBR" = "FLI" -o ! -f "$GSDLHOME/gs2-server.sh" ]; then
|
---|
118 | "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS $*
|
---|
119 | exit_status=$?
|
---|
120 | # GS2 localLib
|
---|
121 | else
|
---|
122 | "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -local_library "$GSDLHOME/gs2-server.sh" $*
|
---|
123 | exit_status=$?
|
---|
124 | fi
|
---|
125 | # GS3
|
---|
126 | elif [ "$_version" -eq 3 ]; then
|
---|
127 | "$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -gsdl3 "$GSDL3HOME" -gsdl3src "$GSDL3SRCHOME" $*
|
---|
128 | exit_status=$?
|
---|
129 | fi
|
---|
130 |
|
---|
131 | if [ "$exit_status" != "2" ] ; then
|
---|
132 | stop_gli=1
|
---|
133 | else
|
---|
134 | echo
|
---|
135 | if [ "$explang" = "es" ]; then
|
---|
136 | echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..."
|
---|
137 | elif [ "$explang" = "fr" ]; then
|
---|
138 | echo "Restarting/Exécution de $PROGNAME..."
|
---|
139 | elif [ "$explang" = "ru" ]; then
|
---|
140 | echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
|
---|
141 | else
|
---|
142 | echo "Restarting the $PROGNAME..."
|
---|
143 | fi
|
---|
144 | fi
|
---|
145 | done
|
---|
146 |
|
---|
147 | if [ "$explang" = "es" ]; then
|
---|
148 | echo "Hecho."
|
---|
149 | elif [ "$explang" = "fr" ]; then
|
---|
150 | echo "Terminé."
|
---|
151 | elif [ "$explang" = "ru" ]; then
|
---|
152 | echo "÷ÙÐÏÌÎÅÎÏ."
|
---|
153 | else
|
---|
154 | echo "Done."
|
---|
155 | fi |
---|