[28721] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | # Need to run this script from its own directory instead of whichever directory it may be called from
|
---|
| 4 | #currentdir=$(cd `dirname "$0"` && pwd)
|
---|
| 5 | thisdir="`dirname \"$0\"`"
|
---|
| 6 | thisdir="`cd \"$thisdir\" && pwd`"
|
---|
| 7 | cd "$thisdir"
|
---|
| 8 | EXPEDITEE_HOME=$thisdir
|
---|
| 9 | export EXPEDITEE_HOME
|
---|
| 10 |
|
---|
| 11 | if test "x$EXPEDITEE_OS" = "x" ; then
|
---|
| 12 | EXPEDITEE_OS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
| 13 | # check for running bash under cygwin
|
---|
| 14 | if test "`echo $EXPEDITEE_OS | sed 's/cygwin//'`" != "$EXPEDITEE_OS" ;
|
---|
| 15 | then
|
---|
| 16 | EXPEDITEE_OS=windows
|
---|
| 17 | fi
|
---|
| 18 | fi
|
---|
| 19 | export EXPEDITEE_OS
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | if [ -z "$exp_lang" ]; then
|
---|
| 23 | exp_lang=en
|
---|
| 24 | fi
|
---|
| 25 |
|
---|
| 26 | PROGNAME="Expeditee"
|
---|
| 27 | PROGFULLNAME=$PROGNAME
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | ## ---- Determine JAVA_HOME ----
|
---|
| 31 | # JRE_HOME or JAVA_HOME must be set correctly to run this program
|
---|
[28740] | 32 | #CLASSPATH
|
---|
| 33 | # if setting classpath, see gs2-server.sh, then export it
|
---|
[28721] | 34 |
|
---|
[28740] | 35 | ## ---- Check Java ----
|
---|
| 36 | # call the script with source, so that we have the variables it sets ($javapath)
|
---|
| 37 | exit_status=0
|
---|
| 38 | source bin/findjava.sh "$exp_lang" "$PROGNAME"
|
---|
| 39 | exit_status=$?
|
---|
| 40 | if [ "$exit_status" -eq 1 ]; then
|
---|
| 41 | exit 1;
|
---|
| 42 | fi
|
---|
| 43 | export PATH=$javahome/bin:$PATH
|
---|
[28721] | 44 |
|
---|
[28740] | 45 | # -Xdock:name To set the name of the app in the MacOS Dock bar
|
---|
| 46 | # -Xdock:icon Path to the MacOS Doc icon (not necessary for GS)
|
---|
| 47 | custom_vm_args=""
|
---|
| 48 | if [ "$EXPEDITEE_OS" = "darwin" ]; then
|
---|
| 49 | custom_vm_args="-Xdock:name=$PROGFULLNAME"
|
---|
| 50 | fi
|
---|
[28721] | 51 |
|
---|
[28740] | 52 | #-Xmx128M -classpath <classpath>...
|
---|
[28721] | 53 |
|
---|
[28740] | 54 | "$javapath" $custom_vm_args -jar Expeditee.jar $*
|
---|
[28721] | 55 |
|
---|
[28740] | 56 | # silent mode: when launched in the background (with & at end), need to
|
---|
| 57 | # redirect any STDERR (STDOUT) output to /dev/null first, else output will hog the x-term.
|
---|
| 58 | #"$javapath" $custom_vm_args org.greenstone.server.Server2 "$GSDLHOME" "$GSDLOS$GSDLARCH" "$serverlang" $* > /dev/null & |
---|