#!/bin/sh serverlang=en echo echo "Greenstone 3 Server" echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato" echo "This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt" echo "This is free software, and you are welcome to redistribute it" echo ## -------- Run the Greenstone 3 Server -------- # This script must be run from within the directory in which it lives thisdir=`pwd` if [ ! -f "${thisdir}/gs3-server.sh" ]; then if [ "$serverlang" == "es" ]; then echo "Este guión deberá ejecutarse desde el directorio en el que reside." elif [ "$serverlang" == "fr" ]; then echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve." elif [ "$serverlang" == "ru" ]; then echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ" else echo "This script must be run from the directory in which it resides." fi exit 1 fi ## ---- Determine GSDL3SRCHOME ---- gsdl3path= # Some users may set the above line manually if [ "x$gsdl3path" == "x" ]; then # Check the environment variable first if [ "x$GSDL3SRCHOME" != "x" ]; then gsdl3path=$GSDL3SRCHOME else gsdl3path=`pwd` fi fi # Setup Greenstone3, unless it has already been done if [ "x$GSDL3SRCHOME" == "x" ]; then pushd $gsdl3path > /dev/null source gs3-setup.sh popd > /dev/null fi ## ---- Check Java exists ---- javapath= # Some users may set the above line manually if [ "x$javapath" = "x" ]; then # If it is set, use the JAVA_HOME environment variable if [ "x$JAVA_HOME" != "x" ]; then javapath="$JAVA_HOME/bin/java" # Check if Java is on the search path else javapath=`which java 2> /dev/null` fi fi # Check that a Java executable has been found if [ "$glilang" = "es" ]; then echo "Revisando Java: $javapath" elif [ "$glilang" = "fr" ]; then echo "Vrification de Java: $javapath" elif [ "$glilang" = "ru" ]; then echo " Java: $javapath" else echo "Checking Java: $javapath" fi if [ ! -x "$javapath" ]; then echo echo "Failed to locate an appropriate version of Java. You must installa" echo "Java Runtime Environment (version 1.4 or greater) before running the" echo "Greenstone Server." exit 1 fi ## -- Check the version of Java is new enough (1.4.0 or higher) to run the Server -- do we need this? #`$javapath -classpath . CheckJavaVersion > /dev/null` #if [ $? -ne 2 ] ; then # echo "The version of the Java Runtime Environment you have installed is too" # echo "old to run the Greenstone Librarian Interface. Please install a new" # echo "version of the JRE (version 1.4 or newer) and rerun this script." #exit 1 #fi ## ---- Check that the server has been compiled ---- if [ ! -f server.jar ]; then echo "You need to compile the server before running this script" exit 1 fi # Other arguments you can provide to java # -XmsM To set minimum memory (by default 32MB) # -XmxM To set maximum memory (by default the nearest 2^n to the total remaining physical memory) # -verbose:gc To set garbage collection messages # -Xincgc For incremental garbage collection (significantly slows performance) # -Xprof Function call profiling # -Xloggc: Write garbage collection log java -cp $CLASSPATH org.greenstone.server.Server $GSDL3SRCHOME