Index: gli/trunk/gli.sh
===================================================================
--- gli/trunk/gli.sh	(revision 17485)
+++ gli/trunk/gli.sh	(revision 17493)
@@ -7,10 +7,10 @@
     # first parameter is value of gsdlpath
     if [ -f "${1}/gs3-setup.sh" ]; then
-	return 3
+    return 3
     elif [ -f "${1}/setup.bash" ]; then
-	return 2
-    else
-	echo "Error: can't determine which Greenstone version is being run."
-	exit 1
+    return 2
+    else
+    echo "Error: can't determine which Greenstone version is being run."
+    exit 1
     fi
 }
@@ -25,31 +25,31 @@
 # Check that the Greenstone installation looks OK
     if [ "$3" = "es" ]; then
-	echo "Revisando GSDL$2: $1"
+    echo "Revisando GSDL$2: $1"
     elif [ "$3" = "fr" ]; then
-	echo "Vérification de GSDL$2: $1"
+    echo "Vérification de GSDL$2: $1"
     elif [ "$3" = "ru" ]; then
-	echo "ðÒÏ×ÅÒËÁ GSDL$2: $1"
-    else
-	echo "Checking GSDL$2: $1"
+    echo "ðÒÏ×ÅÒËÁ GSDL$2: $1"
+    else
+    echo "Checking GSDL$2: $1"
     fi
     # even if we are only checking for gs2build (gsdl2path), we still 
     # need the file setup.bash to exist in the following condition:
     if [ ! -f "${1}/gs3-setup.sh" -a ! -f "${1}/setup.bash" ] ; then
-	echo
-	if [ "$3" = "es" ]; then
-	    echo "No se pudo encontrar la instalación de Greenstone $2 o está incompleta."
-	    echo "Trate de reinstalar Greenstone $2 y a continuación ejecute nuevamente"
-	    echo "este guión."
-	elif [ "$3" = "fr" ]; then
-	    echo "L'installation de Greenstone $2 est introuvable ou incomplète."
-	    echo "Essayez de réinstaller Greenstone $2 et exécutez ce script à nouveau."
-	elif [ "$3" = "ru" ]; then
-	    echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone $_version ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
-	    echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone $2, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
-	else
-	    echo "The Greenstone $2 installation could not be found, or is incomplete."
-	    echo "Try reinstalling Greenstone $2 then running this script again."
-	fi
-	exit 1
+    echo
+    if [ "$3" = "es" ]; then
+        echo "No se pudo encontrar la instalación de Greenstone $2 o está incompleta."
+        echo "Trate de reinstalar Greenstone $2 y a continuación ejecute nuevamente"
+        echo "este guión."
+    elif [ "$3" = "fr" ]; then
+        echo "L'installation de Greenstone $2 est introuvable ou incomplète."
+        echo "Essayez de réinstaller Greenstone $2 et exécutez ce script à nouveau."
+    elif [ "$3" = "ru" ]; then
+        echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone $_version ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
+        echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone $2, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
+    else
+        echo "The Greenstone $2 installation could not be found, or is incomplete."
+        echo "Try reinstalling Greenstone $2 then running this script again."
+    fi
+    exit 1
     fi
 }
@@ -110,9 +110,9 @@
         echo "Este guión deberá ejecutarse desde el directorio en el que reside."
     elif [ "$glilang" = "fr" ]; then
-	echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
+    echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
     elif [ "$glilang" = "ru" ]; then
-	echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
-    else
-	echo "This script must be run from the directory in which it resides."
+    echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
+    else
+    echo "This script must be run from the directory in which it resides."
     fi
     exit 1
@@ -138,26 +138,26 @@
     if [ "x$GSDLHOME" != "x" -a "x$GSDL3SRCHOME" != "x" ]; then
         # _version not set, but both env vars set, so default to 3
-	_version=3
-	gsdlpath=$GSDL3SRCHOME
-	echo "Both Greenstone 2 and Greenstone 3 environments are set." 
-	echo "It is assumed you want to run Greenstone 3."
-	echo "If you want to run Greenstone 2, please unset the"
-	echo "environment variable GSDL3SRCHOME before running GLI."
-	echo ""
+    _version=3
+    gsdlpath=$GSDL3SRCHOME
+    echo "Both Greenstone 2 and Greenstone 3 environments are set." 
+    echo "It is assumed you want to run Greenstone 3."
+    echo "If you want to run Greenstone 2, please unset the"
+    echo "environment variable GSDL3SRCHOME before running GLI."
+    echo ""
     elif [ "x$GSDL3SRCHOME" != "x" ]; then
-	echo "Only gsdl3srchome set"
-	gsdlpath=$GSDL3SRCHOME
-	_version=3
-	echo "$gsdlpath"
+    echo "Only gsdl3srchome set"
+    gsdlpath=$GSDL3SRCHOME
+    _version=3
+    echo "$gsdlpath"
     elif [ "x$GSDLHOME" != "x" ]; then
-	gsdlpath=$GSDLHOME
-	_version=2
+    gsdlpath=$GSDLHOME
+    _version=2
     # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
     else
-	gsdlpath=`(cd .. && pwd)`
-	# Still need to find what version we are running:
-	# GS3 main directory contains file gs3-setup.sh, GS2 only setup.bash
-	get_version $gsdlpath
-	_version=$?
+    gsdlpath=`(cd .. && pwd)`
+    # Still need to find what version we are running:
+    # GS3 main directory contains file gs3-setup.sh, GS2 only setup.bash
+    get_version $gsdlpath
+    _version=$?
     fi
 fi
@@ -175,7 +175,7 @@
     # Setup Greenstone 2, unless it has already been done
     if [ "x$GSDLHOME" = "x" ]; then
-	cd "$gsdlpath"
-	. setup.bash
-	cd "$thisdir"
+    cd "$gsdlpath"
+    . setup.bash
+    cd "$thisdir"
     fi
 # else, if we're running GS3
@@ -183,7 +183,7 @@
     # Setup Greenstone 3, unless it has already been done
     if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
-	cd "$gsdlpath"
-	. gs3-setup.sh
-	cd "$thisdir"
+    cd "$gsdlpath"
+    . gs3-setup.sh
+    cd "$thisdir"
     fi
     
@@ -196,12 +196,12 @@
     if [ "x$gsdl2path" = "x" ]; then
         # Check the environment variable first
-	if [ "x$GSDLHOME" != "x" ]; then
-	    echo "GSDLHOME environment variable is set to $GSDLHOME."
-	    echo "Will use this to find build scripts."
-	    gsdl2path=$GSDLHOME
+    if [ "x$GSDLHOME" != "x" ]; then
+        echo "GSDLHOME environment variable is set to $GSDLHOME."
+        echo "Will use this to find build scripts."
+        gsdl2path=$GSDLHOME
         # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
-	else
-	    gsdl2path=$GSDL3SRCHOME/gs2build
-	fi
+    else
+        gsdl2path=$GSDL3SRCHOME/gs2build
+    fi
     fi
     # Check that Greenstone 3's Greenstone 2 stuff looks OK (in gs2build)
@@ -210,7 +210,7 @@
     # Setup Greenstone 3's gs2build, unless it has already been done
     if [ "x$GSDLHOME" = "x" ]; then
-	cd "$gsdl2path"
-	. setup.bash
-	cd "$thisdir"
+    cd "$gsdl2path"
+    . setup.bash
+    cd "$thisdir"
     fi
 
@@ -242,103 +242,135 @@
 
 # Check that a Perl executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Perl: $perlpath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Perl: $perlpath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
-else
-    echo "Checking Perl: $perlpath"
-fi
+echo "Perl:"
 if [ ! -x "$perlpath" ] ; then
     echo
     if [ "$glilang" = "es" ]; then
-	echo "La Interfaz de la $PROGNAME requiere Perl para "
-	echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
-	echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
-	echo "continuación ejecute nuevamente este guión."
+    echo "La Interfaz de la $PROGNAME requiere Perl para "
+    echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
+    echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
+    echo "continuación ejecute nuevamente este guión."
     elif [ "$glilang" = "fr" ]; then
-	echo "$PROGNAME nécessite Perl pour son fonctionnement,"
-	echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
-	echo "assurer que perl est installé et est spécifié dans votre chemin de "
-	echo "recherche, puis redémarrez ce script."
+    echo "$PROGNAME nécessite Perl pour son fonctionnement,"
+    echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
+    echo "assurer que perl est installé et est spécifié dans votre chemin de "
+    echo "recherche, puis redémarrez ce script."
     elif [ "$glilang" = "ru" ]; then
-	echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
-	echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
-	echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
-	echo "ÜÔÏÔ ÓËÒÉÐÔ."
-    else
-	echo "The $PROGNAME requires Perl in order to operate,"
-	echo "but perl could not be detected on your system. Please ensure that perl"
-	echo "is installed and is on your search path, then rerun this script."
-    fi
-    exit 1
-fi
-
+    echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
+    echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
+    echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
+    echo "ÜÔÏÔ ÓËÒÉÐÔ."
+    else
+    echo "The $PROGNAME requires Perl in order to operate,"
+    echo "but perl could not be detected on your system. Please ensure that perl"
+    echo "is installed and is on your search path, then rerun this script."
+    fi
+    exit 1
+fi
+echo $perlpath
+echo
 
 ## ---- Check Java ----
-# Some users may set the above line manually
+echo "Java:"
+MINIMUM_JAVA_VERSION=1.4.0_00
+
+# Some users may set this line manually
 javapath=
+
 if [ "$javapath" == "" ]; then
 
-	HINT=`cd ..;pwd`
-	javapath=`../bin/search4j -e -p $HINT -m 1.4.0_00`
+    # sus out search4j
+    if [ "$_version" -eq 2 -a -x "$GSDLHOME/bin/search4j" ]; then
+        SEARCH4J_EXECUTABLE=$GSDLHOME/bin/search4j
+    elif [ "$_version" -eq 3 -a -x "$GSDL3SRCHOME/bin/search4j" ]; then
+        SEARCH4J_EXECUTABLE=$GSDL3SRCHOME/bin/search4j
+    elif [ -x "../bin/search4j/search4j" ]; then
+        SEARCH4J_EXECUTABLE=../bin/search4j
+    else
+        echo "Couldn't determine the location of the search4j executable"
+        echo "If you are running Greenstone2"
+        echo "   * check GSDLHOME is set"
+        echo "   * check bin/search4j exists"
+        echo "   * check bin/search4j is executable"
+        echo "If you are running Greenstone3"
+        echo "   * check GSDL3SRCHOME is set"
+        echo "   * check bin/search4j exists"
+        echo "   * check bin/search4j is executable"
+        echo "   * try running 'ant compile-search4j'"
+
+        # last-resort tricks
+        if [ -e "../packages/jre" ]; then
+            function search4j_shell_function() {
+              echo `cd ../packages/jre/bin; pwd`/java
+            }
+            SEARCH4J_EXECUTABLE=search4j_shell_function
+        elif [ "$JAVA_HOME" != "" ]; then
+            function search4j_shell_function() {
+              echo $JAVA_HOME/bin/java
+            }
+            SEARCH4J_EXECUTABLE=search4j_shell_function
+        else
+            exit 1
+        fi
+    fi
+
+    HINT=`cd ..;pwd`
+    javapath=`$SEARCH4J_EXECUTABLE -e -p $HINT -m $MINIMUM_JAVA_VERSION`
 
     if [ "$?" != "0" ]; then
 
-		../bin/search4j -e -p $HINT
-
-		if [ "$?" != "0" ]; then
-
-		    if [ "$glilang" = "es" ]; then
-				echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
-				echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
-				echo "la Interfaz de la $PROGNAME. Por favor instale "
-				echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
-				echo "posterior) y ejecute nuevamente este guión."
-		    elif [ "$glilang" = "fr" ]; then
-				echo "La version de Java Runtime Environment que vous avez installée est"
-				echo "trop vielle pour faire fonctionner $PROGNAME."
-				echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
-				echo "récente) et redémarrez le script."
-		    elif [ "$glilang" = "ru" ]; then
-				echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
-				echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
-				echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
-				echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
-		    else
-				echo "The version of the Java Runtime Environment you have installed is too"
-				echo "old to run the $PROGNAME. Please install a new"
-				echo "version of the JRE (version 1.4 or newer) and rerun this script."
-		    fi
-		    exit 1
-
-		else
-
-		    echo
-		    if [ "$glilang" = "es" ]; then
-				echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
-				echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
-				echo "antes de correr la Interfaz de la $PROGNAME."
-		    elif [ "$glilang" = "fr" ]; then
-				echo "Une version adéquate de Java n'a pas pu être localisée."
-				echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
-				echo "supérieur) avant de démarrer $PROGNAME."
-		    elif [ "$glilang" = "ru" ]; then
-				echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
-				echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
-				echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME."
-		    else
-				echo "Failed to locate an appropriate version of Java. You must install a"
-				echo "Java Runtime Environment (version 1.4 or greater) before running the"
-				echo "$PROGNAME."
-		    fi
-		fi
-
-	fi
-
-fi
-
-echo "Java: $javapath"
+        OLDVER=`$SEARCH4J_EXECUTABLE -v -p $HINT`
+
+        if [ "$?" == "0" ]; then
+
+            if [ "$glilang" = "es" ]; then
+                echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
+                echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
+                echo "la Interfaz de la $PROGNAME. Por favor instale "
+                echo "una nueva versión del Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o "
+                echo "posterior) y ejecute nuevamente este guión."
+            elif [ "$glilang" = "fr" ]; then
+                echo "La version de Java Runtime Environment que vous avez installée est"
+                echo "trop vielle pour faire fonctionner $PROGNAME."
+                echo "Veuillez installer une nouvelle version du JRE (version $MINIMUM_JAVA_VERSION ou plus"
+                echo "récente) et redémarrez le script."
+            elif [ "$glilang" = "ru" ]; then
+                echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
+                echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
+                echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
+                echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
+            else
+                echo "The version of the Java Runtime Environment you have installed ($OLDVER)"
+                echo "is too old to run the $PROGNAME. Please install a new"
+                echo "version of the JRE (version $MINIMUM_JAVA_VERSION or newer) and rerun this script."
+            fi
+            exit 1
+
+        else
+
+            echo
+            if [ "$glilang" = "es" ]; then
+                echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
+                echo "instalar un Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o superior) "
+                echo "antes de correr la Interfaz de la $PROGNAME."
+            elif [ "$glilang" = "fr" ]; then
+                echo "Une version adéquate de Java n'a pas pu être localisée."
+                echo "Vous devez installer un Java Runtime Environment (version $MINIMUM_JAVA_VERSION ou"
+                echo "supérieur) avant de démarrer $PROGNAME."
+            elif [ "$glilang" = "ru" ]; then
+                echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
+                echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ×ÙÛÅ)"
+                echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME."
+            else
+                echo "Failed to locate an appropriate version of Java. You must install a"
+                echo "Java Runtime Environment (version $MINIMUM_JAVA_VERSION or greater) before running the"
+                echo "$PROGNAME."
+            fi
+        fi
+
+    fi
+
+fi
+echo $javapath
+echo
 
 
@@ -353,15 +385,15 @@
     echo
     if [ "$glilang" = "es" ]; then
-	echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
-	echo "(por medio de makegli.sh) antes de ejecutar este guión."
+    echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
+    echo "(por medio de makegli.sh) antes de ejecutar este guión."
     elif [ "$glilang" = "fr" ]; then
-	echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
-	echo "avant d'exécuter ce script."
+    echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
+    echo "avant d'exécuter ce script."
     elif [ "$glilang" = "ru" ]; then
-	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
-	echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
-    else
-	echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
-	echo "before running this script."
+    echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
+    echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
+    else
+    echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
+    echo "before running this script."
     fi
     exit 1
@@ -395,25 +427,25 @@
     exit_status=0
     if [ "$_version" -eq 2 ]; then
-	`$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS $*`
-	exit_status=$?
+    `$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS $*`
+    exit_status=$?
     elif [ "$_version" -eq 3 ]; then    
-	`$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*`
-	exit_status=$?
+    `$basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*`
+    exit_status=$?
     fi
     
     if [ "$exit_status" != "2" ] ; then
-	stop_gli=1
-    else
-	echo
-	if [ "$glilang" = "es" ]; then
-	    echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..."
-	elif [ "$glilang" = "fr" ]; then
-	    echo "Restarting/Exécution de $PROGNAME..."
-	elif [ "$glilang" = "ru" ]; then
-	    echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
-	else
-	    echo "Restarting the $PROGNAME..."
-	fi
-	
+    stop_gli=1
+    else
+    echo
+    if [ "$glilang" = "es" ]; then
+        echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..."
+    elif [ "$glilang" = "fr" ]; then
+        echo "Restarting/Exécution de $PROGNAME..."
+    elif [ "$glilang" = "ru" ]; then
+        echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
+    else
+        echo "Restarting the $PROGNAME..."
+    fi
+    
     fi
 done 
