Ignore:
Timestamp:
2011-04-23T17:50:37+12:00 (13 years ago)
Author:
davidb
Message:

Introduction of GSDLARCH to support linux32 and linux64 folders, if having multiple binaries in one Greenstone installation. In the event setup.bash cannont find bin/linux32 (or linux64) it sets GSDLARCH to be the empty string, thereby letting everything else continue as is used to be. Further, dymaically tests to see if cgi-bin/linux32 (or 64) exists, in which case this is the point used for this OS's cgi-bin programs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/gsicontrol.sh

    r23945 r23948  
    22
    33testdone=0
     4
     5cgibin="cgi-bin"
     6if [ -d "cgi-bin/$GSDLOS$GSDLARCH" ] ; then
     7  cgibin="cgi-bin/$GSDLOS$GSDLARCH"
     8fi
     9
    410
    511function test-gsdlhome {
     
    2329function configure-cgi {
    2430    test-gsdlhome
    25     if test ! -e $GSDLHOME/cgi-bin/gsdlsite.cfg ; then
    26     echo "Configuring cgi-bin/gsdlsite.cfg" ;
    27     sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" cgi-bin/gsdlsite.cfg.in > cgi-bin/gsdlsite.cfg ;
     31    if test ! -e "$GSDLHOME/$cgibin/gsdlsite.cfg" ; then
     32    echo "Configuring $cgibin/gsdlsite.cfg" ;
     33    sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" "$cgibin/gsdlsite.cfg.in" > "$cgibin/gsdlsite.cfg" ;
    2834    else
    2935    echo "WARNING: Nothing done for make configure-cgi." ;
    3036    echo "   If you wish to regenerate the file " ;
    31     echo "   $GSDLHOME/cgi-bin/gsdlsite.cfg" ;
     37    echo "   $GSDLHOME/$cgibin/gsdlsite.cfg" ;
    3238    echo "   from scratch, delete the existing file first." ;
    3339    fi
     
    7177    fi
    7278
    73     if test -e $GSDLHOME/cgi-bin/gsdlsite.cfg ; then
    74     collecthome=`egrep "^collecthome" $GSDLHOME/cgi-bin/gsdlsite.cfg | awk '{print $2}'` ;
     79    if test -e "$GSDLHOME/$cgibin/gsdlsite.cfg" ; then
     80    collecthome=`egrep "^collecthome" "$GSDLHOME/$cgibin/gsdlsite.cfg" | awk '{print $2}'` ;
    7581    fi
    7682    if test -z $collecthome ; then
     
    8389    web-stop-tested ;
    8490    echo "Setting config file to use port $port";
    85     cat "$GSDLHOME/apache-httpd/$GSDLOS/conf/httpd.conf.in" \
     91    cat "$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/conf/httpd.conf.in" \
    8692    | sed "s@\*\*PORT\*\*@$port@g" \
    8793    | sed "s@\*\*CONNECTPERMISSION\*\*@$allowfromall@g" \
     
    9096    | sed "s@\*\*COLLECTHOME\*\*@$collecthome@g" \
    9197    | sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" \
    92     | sed "s@\*\*APACHE_HOME_OS\*\*@$GSDLHOME/apache-httpd/$GSDLOS@g" \
     98    | sed "s@\*\*APACHE_HOME_OS\*\*@$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH@g" \
    9399    | sed "s@\*\*LIBRARY_PATH_VAR\*\*@$lib_path_var@g" \
    94     > "$GSDLHOME/apache-httpd/$GSDLOS/conf/httpd.conf" ;
     100    > "$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/conf/httpd.conf" ;
    95101    echo "Type '$0 web-start' to start the web server running on port $port" ;
    96102    fi ;
     
    126132
    127133    echo -e "$port\n$hostIP\n$hosts\n$externalaccess" | configure-port-and-connection ;
    128     if test -e "$GSDLHOME/apache-httpd/$GSDLOS/conf/httpd.conf" ; then
     134    if test -e "$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/conf/httpd.conf" ; then
    129135    echo $MONITOR_SUCCESS;
    130136    else
     
    141147# forces configure-cgi by deleting gsdlsite.cfg
    142148function reset-gsdlhome {   
    143     if test -e "$GSDLHOME/cgi-bin/gsdlsite.cfg" ; then
    144     echo "**** WARNING. Local changes made to $GSDLHOME/cgi-bin/gsdlsite.cfg will be lost.";
    145     rm -f "$GSDLHOME/cgi-bin/gsdlsite.cfg";
     149    if test -e "$GSDLHOME/$cgibin/gsdlsite.cfg" ; then
     150    echo "**** WARNING. Local changes made to $GSDLHOME/$cgibin/gsdlsite.cfg will be lost.";
     151    rm -f "$GSDLHOME/$cgibin/gsdlsite.cfg";
    146152    fi
    147153    configure-web $1
     
    150156function web-status {
    151157    test-gsdlhome
    152     $GSDLHOME/apache-httpd/$GSDLOS/bin/apachectl status
     158    $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl status
    153159}
    154160
    155161function web-start {
    156162    test-gsdlhome
    157     $GSDLHOME/apache-httpd/$GSDLOS/bin/apachectl start
     163    $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl start
    158164    if [ $? = 0 ] ; then
    159165    echo $MONITOR_SUCCESS;
     
    166172function web-restart {
    167173    test-gsdlhome
    168     $GSDLHOME/apache-httpd/$GSDLOS/bin/apachectl restart
     174    $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl restart
    169175    if [ $? = 0 ] ; then
    170176    echo $MONITOR_SUCCESS;
     
    177183function web-graceful {
    178184    test-gsdlhome
    179     $GSDLHOME/apache-httpd/$GSDLOS/bin/apachectl graceful
     185    $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl graceful
    180186    if [ $? = 0 ] ; then
    181187    echo $MONITOR_SUCCESS;
     
    191197# been done.  This avoids an unnecessary repetition of printing
    192198# out the values of GSDLHOME and GSDLOS
    193     if test -e "$GSDLHOME/apache-httpd/$GSDLOS/conf/httpd.conf" ; then
    194     $GSDLHOME/apache-httpd/$GSDLOS/bin/apachectl stop ;
     199    if test -e "$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/conf/httpd.conf" ; then
     200    $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl stop ;
    195201    fi
    196202}
     
    220226    echo "   configure-apache [config-filename]"
    221227    echo "   configure-cgi"
    222     echo "   reset-gsdlhome [config-filename]\n\t(Save a copy of cgi-bin/gsdlsite.cfg to preserve any customisations)"
     228    echo "   reset-gsdlhome [config-filename]\n\t(Save a copy of $cgibin/gsdlsite.cfg to preserve any customisations)"
    223229    echo "   test-gsdlhome"
    224230    echo "   web-stop-tested"
Note: See TracChangeset for help on using the changeset viewer.