source: greenstone3/trunk/gs3-server.sh@ 20059

Last change on this file since 20059 was 20059, checked in by oranfry, 15 years ago

making search4j calls use the bundled jre as a priority hint consistently, and added quotes to a few paths

  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
RevLine 
[19937]1#!/bin/bash
[13235]2serverlang=en
3
[15131]4java_min_version=1.4.0_00
5
[18559]6autoset_gsdl_home() {
7
8 # remove leading ./ if present
9 prog=${0#./}
10
11 isrelative=${prog%%/*}
12
13 if [ ! -z $isrelative ] ; then
14 # some text is left after stripping
15 # => is relative
16 pwd=$PWD
17 prog="$pwd/$prog"
18 fi
19
20 fulldir=${prog%/*}
21
22 # remove trailing /. if present
23 eval $1=${fulldir%/.}
24}
25
26
[13235]27echo "Greenstone 3 Server"
[18559]28echo "Copyright (C) 2009, New Zealand Digital Library Project, University Of Waikato"
[13235]29echo "This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
30echo "This is free software, and you are welcome to redistribute it"
31
32## -------- Run the Greenstone 3 Server --------
33
34
35## ---- Determine GSDL3SRCHOME ----
36gsdl3path=
37
38# Some users may set the above line manually
[14727]39if [ -z "$gsdl3path" ]; then
[18559]40 autoset_gsdl_home gsdl3path
[13235]41fi
42
[15131]43# Setup Greenstone3, unless it has already been done
[14727]44if [ -z "$GSDL3SRCHOME" ]; then
45 pushd $gsdl3path > /dev/null
46 source gs3-setup.sh
47 popd > /dev/null
[13235]48fi
49
50
[14727]51# JRE_HOME or JAVA_HOME must be set correctly to run this program
[20059]52HINT="`pwd`/packages/jre"
53javapath=`search4j -p "$HINT" -m $java_min_version -e`
[15132]54if [ "$?" == "0" ]; then
[18559]55 # In Java code, '...getResourceAsStream("build.properties")'
56 # needs up to be in the right directory when run
[20059]57 pushd "$gsdl3path" > /dev/null
[18559]58
[20059]59 "$javapath" org.greenstone.server.Server3 "$GSDL3SRCHOME" $serverlang
[18559]60
61 popd > /dev/null
[15132]62fi
[13235]63
Note: See TracBrowser for help on using the repository browser.