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

Last change on this file since 20188 was 20188, checked in by kjdon, 12 years ago

removed the test around sourcing gs3-setup.sh so that it always gets run

  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 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
44pushd $gsdl3path > /dev/null
45source ./gs3-setup.sh
46popd > /dev/null
47
48# JRE_HOME or JAVA_HOME must be set correctly to run this program
49HINT="`pwd`/packages/jre"
50javapath=`search4j -p "$HINT" -m $java_min_version -e`
51if [ "$?" == "0" ]; then
52 # In Java code, '...getResourceAsStream("build.properties")'
53 # needs up to be in the right directory when run
54 pushd "$gsdl3path" > /dev/null
55
56 "$javapath" org.greenstone.server.Server3 "$GSDL3SRCHOME" $serverlang
57
58 popd > /dev/null
59fi
60
Note: See TracBrowser for help on using the repository browser.