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

Last change on this file since 20059 was 20059, checked in by oranfry, 14 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
Line 
1#!/bin/bash
2serverlang=en
3
4java_min_version=1.4.0_00
5
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
27echo "Greenstone 3 Server"
28echo "Copyright (C) 2009, New Zealand Digital Library Project, University Of Waikato"
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
39if [ -z "$gsdl3path" ]; then
40 autoset_gsdl_home gsdl3path
41fi
42
43# Setup Greenstone3, unless it has already been done
44if [ -z "$GSDL3SRCHOME" ]; then
45 pushd $gsdl3path > /dev/null
46 source gs3-setup.sh
47 popd > /dev/null
48fi
49
50
51# JRE_HOME or JAVA_HOME must be set correctly to run this program
52HINT="`pwd`/packages/jre"
53javapath=`search4j -p "$HINT" -m $java_min_version -e`
54if [ "$?" == "0" ]; then
55 # In Java code, '...getResourceAsStream("build.properties")'
56 # needs up to be in the right directory when run
57 pushd "$gsdl3path" > /dev/null
58
59 "$javapath" org.greenstone.server.Server3 "$GSDL3SRCHOME" $serverlang
60
61 popd > /dev/null
62fi
63
Note: See TracBrowser for help on using the repository browser.