source: other-projects/expeditee-release-kits/scripts/run.sh@ 28721

Last change on this file since 28721 was 28721, checked in by ak19, 10 years ago

Add scripts to find java and run expeditee, make installer copy scripts to installation directory, and chmod them to be executable

  • Property svn:executable set to *
File size: 1.9 KB
Line 
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)
5thisdir="`dirname \"$0\"`"
6thisdir="`cd \"$thisdir\" && pwd`"
7cd "$thisdir"
8EXPEDITEE_HOME=$thisdir
9export EXPEDITEE_HOME
10
11if 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
18fi
19export EXPEDITEE_OS
20
21
22if [ -z "$exp_lang" ]; then
23 exp_lang=en
24fi
25
26PROGNAME="Expeditee"
27PROGFULLNAME=$PROGNAME
28
29
30## ---- Determine JAVA_HOME ----
31# JRE_HOME or JAVA_HOME must be set correctly to run this program
32java_min_version=1.8.0_00
33bin/search4j -m $java_min_version &> /dev/null
34# for some reason, Mac requires an echo after the above
35echo
36if [ "$?" == "0" ]; then
37
38 #CLASSPATH
39 # if setting classpath, see gs2-server.sh, then export it
40
41 ## ---- Check Java ----
42 # call the script with source, so that we have the variables it sets ($javapath)
43 exit_status=0
44 source bin/findjava.sh "$exp_lang" "$PROGNAME"
45 exit_status=$?
46 if [ "$exit_status" -eq 1 ]; then
47 exit 1;
48 fi
49 export PATH=$javahome/bin:$PATH
50
51 # -Xdock:name To set the name of the app in the MacOS Dock bar
52 # -Xdock:icon Path to the MacOS Doc icon (not necessary for GS)
53 custom_vm_args=""
54 if [ "$EXPEDITEE_OS" = "darwin" ]; then
55 custom_vm_args="-Xdock:name=$PROGFULLNAME"
56 fi
57
58 #-Xmx128M -classpath <classpath>...
59
60 "$javapath" $custom_vm_args -jar Expeditee.jar $*
61
62 # silent mode: when launched in the background (with & at end), need to
63 # redirect any STDERR (STDOUT) output to /dev/null first, else output will hog the x-term.
64 #"$javapath" $custom_vm_args org.greenstone.server.Server2 "$GSDLHOME" "$GSDLOS$GSDLARCH" "$serverlang" $* > /dev/null &
65fi
Note: See TracBrowser for help on using the repository browser.