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

Last change on this file since 20187 was 20187, checked in by kjdon, 15 years ago

added some quotes around various paths so that can install into somewhere with spaces in path

  • 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
[20187]9 prog="${0#./}"
[18559]10
[20187]11 isrelative="${prog%%/*}"
[18559]12
13 if [ ! -z $isrelative ] ; then
14 # some text is left after stripping
15 # => is relative
[20187]16 pwd="$PWD"
[18559]17 prog="$pwd/$prog"
18 fi
19
[20187]20 fulldir="${prog%/*}"
[18559]21
22 # remove trailing /. if present
[20187]23 eval $1=\""${fulldir%/.}"\"
[18559]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
[20187]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
[20187]50echo $PATH
[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.