- Timestamp:
- 2011-04-23T17:50:37+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/gsicontrol.sh
r23945 r23948 2 2 3 3 testdone=0 4 5 cgibin="cgi-bin" 6 if [ -d "cgi-bin/$GSDLOS$GSDLARCH" ] ; then 7 cgibin="cgi-bin/$GSDLOS$GSDLARCH" 8 fi 9 4 10 5 11 function test-gsdlhome { … … 23 29 function configure-cgi { 24 30 test-gsdlhome 25 if test ! -e $GSDLHOME/cgi-bin/gsdlsite.cfg; then26 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" ; 28 34 else 29 35 echo "WARNING: Nothing done for make configure-cgi." ; 30 36 echo " If you wish to regenerate the file " ; 31 echo " $GSDLHOME/ cgi-bin/gsdlsite.cfg" ;37 echo " $GSDLHOME/$cgibin/gsdlsite.cfg" ; 32 38 echo " from scratch, delete the existing file first." ; 33 39 fi … … 71 77 fi 72 78 73 if test -e $GSDLHOME/cgi-bin/gsdlsite.cfg; then74 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}'` ; 75 81 fi 76 82 if test -z $collecthome ; then … … 83 89 web-stop-tested ; 84 90 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" \ 86 92 | sed "s@\*\*PORT\*\*@$port@g" \ 87 93 | sed "s@\*\*CONNECTPERMISSION\*\*@$allowfromall@g" \ … … 90 96 | sed "s@\*\*COLLECTHOME\*\*@$collecthome@g" \ 91 97 | 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" \ 93 99 | 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" ; 95 101 echo "Type '$0 web-start' to start the web server running on port $port" ; 96 102 fi ; … … 126 132 127 133 echo -e "$port\n$hostIP\n$hosts\n$externalaccess" | configure-port-and-connection ; 128 if test -e "$GSDLHOME/apache-httpd/$GSDLOS /conf/httpd.conf" ; then134 if test -e "$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/conf/httpd.conf" ; then 129 135 echo $MONITOR_SUCCESS; 130 136 else … … 141 147 # forces configure-cgi by deleting gsdlsite.cfg 142 148 function reset-gsdlhome { 143 if test -e "$GSDLHOME/ cgi-bin/gsdlsite.cfg" ; then144 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"; 146 152 fi 147 153 configure-web $1 … … 150 156 function web-status { 151 157 test-gsdlhome 152 $GSDLHOME/apache-httpd/$GSDLOS /bin/apachectl status158 $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl status 153 159 } 154 160 155 161 function web-start { 156 162 test-gsdlhome 157 $GSDLHOME/apache-httpd/$GSDLOS /bin/apachectl start163 $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl start 158 164 if [ $? = 0 ] ; then 159 165 echo $MONITOR_SUCCESS; … … 166 172 function web-restart { 167 173 test-gsdlhome 168 $GSDLHOME/apache-httpd/$GSDLOS /bin/apachectl restart174 $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl restart 169 175 if [ $? = 0 ] ; then 170 176 echo $MONITOR_SUCCESS; … … 177 183 function web-graceful { 178 184 test-gsdlhome 179 $GSDLHOME/apache-httpd/$GSDLOS /bin/apachectl graceful185 $GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin/apachectl graceful 180 186 if [ $? = 0 ] ; then 181 187 echo $MONITOR_SUCCESS; … … 191 197 # been done. This avoids an unnecessary repetition of printing 192 198 # out the values of GSDLHOME and GSDLOS 193 if test -e "$GSDLHOME/apache-httpd/$GSDLOS /conf/httpd.conf" ; then194 $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 ; 195 201 fi 196 202 } … … 220 226 echo " configure-apache [config-filename]" 221 227 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)" 223 229 echo " test-gsdlhome" 224 230 echo " web-stop-tested"
Note:
See TracChangeset
for help on using the changeset viewer.