#!/bin/bash #!/usr/bin/ksh #Try this or some other first line if above doesn\'t work #Copyright Olaf Kayser 2006- (Open Source/GNU Affero General Public License) #20060425: Major overhaul #TO DO: # Check that export X=something works (or change to: X=something ; export X) function warning() { echo '!!' $* '!!' } function errorexit() { echo $* echo Installation aborted. exit 1 } echo Current directory: $PWD echo echo '-------' echo Checking python is available/executable and above 1.5.2 python > tempfile <= '2' : print version ? if [ "$?" -ne 0 ] then errorexit "Not able to execute python" fi if [ ! -s tempfile ] then warning "Too old version of python. Must be Python2.? or higher.\n\n\n" fi echo echo '-------' echo Checking availability of either sed or ed export SED=`which sed` # Using sed if available if [ ! -x "$SED" ] then export ED=`which ed` if [ ! -x "$ED" ] then errorexit "Neither sed nor ed available. Installation aborted." fi # ed available, we'll try using it: SED='' fi echo echo '-------' echo Checking path and name of current directory echo Current directory: $PWD python < install.var if [ $? -ne 0 ] then errorexit "Current directory $PWD has no permission to write file" fi fi fi echo creating extract \(install.var.xtr\) of install.var with definitions only grep '^ *export' install.var > install.var.xtr echo echo '-------' echo Checking important install variables have been defined in file install.var. echo Otherwise attemting to define them echo Current directory: $PWD function addToInstallvar() { echo Setting $1 edit_install_var=1 if [ ! -f 0install.var ] then cp install.var 0install.var echo >> install.var echo \# Added `date '+%Y%m%d'` by $0: >> install.var fi echo Adding export $1 in file install.var echo export $1 >> install.var } if [ -n "$PYTHON" ] then if [ ${PYTHON:0:1} != '/' ] then errorexit $PYTHON ' is not an absolute path and name (must start with /)' fi echo Variable PYTHON was defined: $PYTHON else export PYTHON=`which python` if [ ! "$PYTHON" ] then echo "Not able to set install variable PYTHON to a useful value" errorexit "Current search PATH=$PATH" fi addToInstallvar "PYTHON=$PYTHON" fi if [ -n "$MAIL" ] then echo Variable MAIL was defined: $MAIL else echo Attempting to set a value for MAIL export MAIL=`which mail` if [ ! "$MAIL" ] then export MAIL=`which xmail` fi if [ ! "$MAIL" ] then warning "Not able to set install variable MAIL to a useful value" fi addToInstallvar "MAIL=$MAIL" fi if [ -n "$ADMINPASSWORD" ] then echo ADMINPASSWORD was defined: $ADMINPASSWORD else echo Attempting to set a value for ADMINPASSWORD # python > tempfile < tempfile </dev/null` if [ "$conf" ] then more_than_one=`echo $conf | grep ' '` if [ ! "$more_than_one" ] then echo File $conf assumed to be server configuration file break fi fi done fi echo Examining conf: $conf if [ -z "$conf" ] then echo Not able to find a server configuration file else echo Searching for User at start of a line in $conf userline=`grep '^User' $conf` if [ -n "$userline" ] then serveruser=`echo $userline | cut -d' ' -f2` else echo No User at start of a line in $conf fi if [ "$USER" = "$serveruser" ] then serverowner=1 echo According to the configuration file you \($USER\) are the serveruser \($serveruser\) else echo WARNING: According to the configuration file you \($USER\) are NOT the serveruser \($serveruser\) echo Possibly, you are the owner of a virtual host echo See server configuration file $conf notserverowner=1 fi fi echo Examining \$DOMAIN: $DOMAIN if [ -n "$DOMAIN" ] then echo Variable DOMAIN was defined: $DOMAIN domain_stated=1 else echo Attempting to set a value for DOMAIN if [ ! "$HOSTNAME" ] then HOSTNAME=`hostname` if [ $? -ne 0 ] then echo 'Executing HOSTNAME=`cat /etc/hostname`' HOSTNAME=`cat /etc/hostname` else echo 'Command `hostname` gave empty result' fi fi if [ -z "$HOSTNAME" ] then errorexit "Not able to determine name \(HOSTNAME\) of this host" fi if [ "$HOSTNAME" -a "$serverowner" ] then echo Executing export DOMAIN=$HOSTNAME export DOMAIN=$HOSTNAME fi if [ -z "$DOMAIN" ] then errorexit "Not able to set install variable DOMAIN" fi warning "Variable DOMAIN may have been set wrongly to $DOMAIN" addToInstallvar "DOMAIN=$DOMAIN" fi echo Examining ADMINMAILADDRESS: $ADMINMAILADDRESS if [ -n "$ADMINMAILADDRESS" ] then echo Variable ADMINMAILADDRESS was defined: $ADMINMAILADDRESS else echo Attempting to set a value for ADMINMAILADDRESS if [ -n "$DOMAIN" ] then export ADMINMAILADDRESS=$USER@$DOMAIN addToInstallvar "ADMINMAILADDRESS=$ADMINMAILADDRESS" else errorexit "Not able to set install variable ADMINMAILADDRESS" fi fi echo Examining \$TESTMAILADDRESS: $TESTMAILADDRESS if [ -n "$TESTMAILADDRESS" ] then echo Variable TESTMAILADDRESS was defined: $TESTMAILADDRESS else echo Attempting to set a value for TESTMAILADDRESS if [ "$DOMAIN" ] then export TESTMAILADDRESS=xxxxxx@$DOMAIN else errorexit "Not able to set install variable TESTMAILADDRESS to a useful value" fi addToInstallvar "TESTMAILADDRESS=$TESTMAILADDRESS" fi echo Examining HTMLDIR: $HTMLDIR if [ -n "$HTMLDIR" ] then echo Variable HTMLDIR was defined: $HTMLDIR else echo Attempting to set a value for \$HTMLDIR if [ "$serverowner" ] then echo Searching for DocumentRoot at start of a line in $conf documentrootline=`grep '^DocumentRoot' $conf` if [ "$documentrootline" ] then export HTMLDIR=`echo $documentrootline | cut -d' ' -f2` fi else # not serverowner, probably ordinary user if [ -d /home ] then echo Searching for directory html, htdocs, public_html, www or web in /home for j in html htdocs public_html www web do echo 'Executing export HTMLDIR=`find /home -name $j`' export HTMLDIR=`find /home -name $j` if [ -n "$HTMLDIR" ] then if [ -d "$HTMLDIR" ] then break fi else echo Variable HTMLDIR got value $HTMLDIR fi done else # maybe owner of virtual host if [ "$domain_stated" -a "$conf" ] then virtualdomain=`grep "ServerName *${DOMAIN}" $conf` if [ "$virtualdomain" ] then echo $DOMAIN presumably defined virtual in $conf $PYTHON > tempfile <= 0 : domain = htmldir = '' while 1 : line = f.readline() if string.find( line, 'ServerName' ) >= 0 : domain = string.strip( string.replace( line, 'ServerName', '' ) ) elif string.find( line, 'DocumentRoot' ) >= 0 : htmldir = string.strip( string.replace( line, 'DocumentRoot', '' ) ) elif string.find( line, '= 0 : break if domain == searched : break # TODO: consider possible use of UserDir and VirtualDocumentRoot f.close() if domain != searched : htmldir = '' print htmldir, ? echo 'Executing export HTMLDIR=`cat tempfile`' export HTMLDIR=`cat tempfile` echo Removing tempfile rm tempfile fi fi fi fi if [ -z "$HTMLDIR" ] then warning "Not able to set install variable HTMLDIR. Try doing it manually." fi addToInstallvar "HTMLDIR=$HTMLDIR" fi # TODO: check the following: echo Examining CGIBINDIR: $CGIBINDIR if [ -z "$CGIBINDIR" ] then echo Attempting to set a value for CGIBINDIR edit_install_var=1 if [ -n "$serverowner" ] then echo Variable serverowner has value $serverowner echo Searching for ScriptAlias at start of a line in $conf echo 'Executing scriptaliasline=`grep '^ScriptAlias' $conf`' scriptaliasline=`grep '^ScriptAlias' $conf` if [ -n "$scriptaliasline" ] then echo scriptaliasline has value $scriptaliasline export CGINAME=`echo -n $scriptaliasline | cut -d' ' -f2` export CGIBINDIR=`echo -n $scriptaliasline | cut -d' ' -f3` else echo scriptaliasline was empty fi else # not serverowner, probably ordinary user echo Installer does not appear to be serverowner, probably ordinary user echo Looking into /home if [ -d /home ] then echo Searching for directory cgi-bin or cgi in /home echo Search may take a while for j in cgi-bin cgi do echo j: $j echo 'Executing export CGIBINDIR=`find /home -name $j`' export CGIBINDIR=`find /home -name $j` if [ -n "$CGIBINDIR" ] then echo CGIBINDIR: $CGIBINDIR if [ -d "$CGIBINDIR" ] then echo CGIBINDIR is a directory break fi fi done else # maybe owner of virtual host echo Considering installer maybe owner of virtual host if [ "$domain_stated" -a "$conf" ] then echo 'Executing virtualdomain=`grep "ServerName *$DOMAIN" $conf`' virtualdomain=`grep "ServerName *$DOMAIN" $conf` if [ -n "$virtualdomain" ] then echo virtualdomain: $virtualdomain echo $DOMAIN presumably defined virtual in $conf $PYTHON > tempfile <= 0 : domain = htmldir = '' while 1 : line = f.readline() if string.find( line, 'ServerName' ) >= 0 : domain = string.strip( string.replace( line, 'ServerName', '' ) ) elif string.find( line, 'ScriptAlias' ) >= 0 : cginame_cgibindir = string.strip( string.replace( line, 'ScriptAlias', '' ) ) elif string.find( line, '= 0 : break if domain == searched : break # TODO: consider possible use of ScriptAliasMatch f.close() if domain != searched : cginame_cgibindir = '' print cginame_cgibindir, ? echo 'Executing cginame_cgibindir=`cat tempfile`' cginame_cgibindir=`cat tempfile` echo cginame_cgibindir: $cginame_cgibindir echo CGINAME: $CGINAME echo CGIBINDIR: $CGIBINDIR echo "Executing export CGINAME=`echo -n $cginame_cgibindir | cut -d' ' -f2`" export CGINAME=`echo -n $cginame_cgibindir | cut -d' ' -f2` echo "Executing export CGIBINDIR=`echo -n $cginame_cgibindir | cut -d' ' -f3`" export CGIBINDIR=`echo -n $cginame_cgibindir | cut -d' ' -f3` echo Removing tempfile rm tempfile fi fi fi fi if [ -z "$CGIBINDIR" ] then errorexit "Not able to set install variable CGIBINDIR. Try doing it manually." fi addToInstallvar "CGIBINDIR=$CGIBINDIR" if [ -z "$CGINAME" ] then errorexit "Not able to set install variable CGINAME. Try doing it manually." fi addToInstallvar "CGINAME=$CGINAME" fi echo Examining \$LEVEL: $LEVEL if [ -z "$LEVEL" ] then export LEVEL='min' addToInstallvar "LEVEL=$LEVEL" else if [ \( "$LEVEL" != 'max' \) -a \( "$LEVEL" != 'min' \) ] then warning 'Bad value for variable LEVEL:' $LEVEL export LEVEL='min' addToInstallvar "LEVEL=$LEVEL" fi fi echo Examining HTACCESS: $HTACCESS if [ -z "$HTACCESS" ] then echo Executing export HTACCESS='' export HTACCESS='' else if [ "$HTACCESS" -eq '1' ] then echo Executing HTACCESS='Options -Indexes' HTACCESS='Options -Indexes' fi fi echo Examining edit_install_var: $edit_install_var if [ "$edit_install_var" ] then echo File install.var has been augmented with new definitions. echo "You can either go to directory $PWD and edit file install.var or" echo "alter the definitions in the install.htm file (assuming you are" echo "installing using that file and install.py via the WEB)." echo "The new definitions/values can be seen above." exit 1 fi export INSTALLD=`pwd` # process in install directory echo INSTALLD set to: $INSTALLD export MODE700=700 export MODE755=755 export MODE600=600 export MODE644=644 echo Examining GROUPPERM: $GROUPPERM if [ -n "$GROUPPERM" ] then MODE700=770 MODE755=775 MODE600=660 MODE644=664 fi echo MODE700 set to: $MODE700 echo MODE775 set to: $MODE775 echo MODE660 set to: $MODE660 echo MODE664 set to: $MODE664 echo Setting access rights $MODE700 for current directory: $PWD \($INSTALLD\) chmod $MODE700 . if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE700 .' echo Could not chmod $MODE700 . echo ls -ld . results in: ls -ld . echo Installation aborted. errorexit fi echo Executing export QUIZCOMPOSER=$QUIZCOMPOSERPARENT/$QUIZCOMPOSERNAME export QUIZCOMPOSER=$QUIZCOMPOSERPARENT/$QUIZCOMPOSERNAME echo Examining \$QUIZCOMPOSER: $QUIZCOMPOSER if [ -d $QUIZCOMPOSER ] then echo Directory $QUIZCOMPOSER exists else echo Directory $QUIZCOMPOSER non-existent. Attempting to create it. mkdir $QUIZCOMPOSER if [ $? -ne 0 ] then errorexit "Could not create $QUIZCOMPOSER" else echo Created $QUIZCOMPOSER fi echo Executing chmod $MODE755 $QUIZCOMPOSER chmod $MODE755 $QUIZCOMPOSER if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE755 $QUIZCOMPOSER' echo 'Could not chmod $MODE755 $QUIZCOMPOSER' echo ls -ld $QUIZCOMPOSER results in: ls -ld $QUIZCOMPOSER errorexit else echo Mode $MODE755 set for $QUIZCOMPOSER fi fi echo Examining HTMLDIR: $HTMLDIR if [ -d $HTMLDIR ] then echo Directory $HTMLDIR exists else echo $HTMLDIR non-existent. Attempting to create it. mkdir $HTMLDIR if [ $? -ne 0 ] then errorexit "Could not create $HTMLDIR" fi fi echo Examining CGIBINDIR: $CGIBINDIR if [ -d $CGIBINDIR ] then echo Directory $CGIBINDIR exists else mkdir $CGIBINDIR if [ $? -ne 0 ] then errorexit "Could not create $CGIBINDIR" fi fi echo Examining \$INSTALLD/install.tgz: $INSTALLD/install.tgz if [ -f $INSTALLD/install.tgz ] then echo Renaming $INSTALLD/install.tgz to $INSTALLD/install.tar.gz mv $INSTALLD/install.tgz $INSTALLD/install.tar.gz if [ $? -ne 0 ] then errorexit "Could not rename $INSTALLD/install.tgz to $INSTALLD/install.tar.gz" fi else echo File $INSTALLD/install.tgz non-existant. Looking for $INSTALLD/install.tar.gz fi echo Examining \$INSTALLD/install.tar.gz: $INSTALLD/install.tar.gz if [ -f $INSTALLD/install.tar.gz ] then echo Removing $INSTALLD/install.tar before unzipping $INSTALLD/install.tar.gz rm -f $INSTALLD/install.tar if [ $? -ne 0 ] then errorexit "Could not remove $INSTALLD/install.tar" fi gunzip $INSTALLD/install.tar.gz if [ $? -ne 0 ] then errorexit "Could not unzip $INSTALLD/install.tar.gz" fi else echo File $INSTALLD/install.tar.gz non-existant. Looking for $INSTALLD/install.tar fi echo Examining \$INSTALLD/install.tar: $INSTALLD/install.tar if [ ! -f $INSTALLD/install.tar ] then errorexit "File $INSTALLD/install.tar missing" else echo File $INSTALLD/install.tar exists fi echo '-------' echo 'Saving information about $HTMLDIR by executing: ls -l $HTMLDIR > ls-l_HTMLDIR' ls -l $HTMLDIR > ls-l_HTMLDIR if [ $? -eq 0 ] then echo Completed else warning "Error while executing ls -l $HTMLDIR > ls-l_HTMLDIR" fi echo echo '-------' echo HTMLDIR is $HTMLDIR echo CGIBINDIR is $CGIBINDIR echo QUIZCOMPOSER is $QUIZCOMPOSER echo Current directory is $PWD echo Examining saved.tgz exists and is a file if [ -f saved.tgz ] then echo File saved.tgz exists. ls -ld saved.tgz else if [ -n "$SAVE_CURRENT" ] then #TODO: rewrite to directly save contents of author and course directories: echo 'File saved.tgz non-existant' echo Saving current \(accessible\) contents of echo $HTMLDIR $CGIBINDIR $QUIZCOMPOSER in saved.tgz: echo Executing tar -cf - $HTMLDIR $CGIBINDIR $QUIZCOMPOSER ... tar -cf - $HTMLDIR $CGIBINDIR $QUIZCOMPOSER 2>/dev/null | gzip > saved.tgz echo Executing chmod $MODE600 saved.tgz chmod $MODE600 saved.tgz echo Current directory: $PWD ls -ld saved.tgz fi fi if [ $DOMAIN = 'www.quizcomposer.dk' ] then echo "Saving files $QUIZCOMPOSER/html.d/examples_*.htm" cp $QUIZCOMPOSER/html.d/examples*.htm $INSTALLD fi echo '-------' cd $QUIZCOMPOSER echo Current directory: $PWD echo Cleaning $QUIZCOMPOSER \(leaving author directories intact\) echo 'Executing rm -rf mod_* phrase_* [b-z]*.d [a-z]*.py *.sh' rm -rf mod_* phrase_* [b-z]*.d [a-z]*.py *.sh if [ $? -eq 0 ] then echo Completed else errorexit 'Error while executing rm -rf mod_* phrase_* [b-z]*.d [a-z]*.py *.sh' fi echo Executing rm -rf cornerlogo.txt domaindependent.txt phrase_dk.txt phrase_en.txt rm -rf cornerlogo.txt domaindependent.txt phrase_dk.txt phrase_en.txt if [ $? -eq 0 ] then echo Completed else errorexit 'Error while executing rm -rf cornerlogo.txt domaindependent.txt phrase_dk.txt phrase_en.txt' fi echo 'Executing rm -rf mkmod* mkpag* mkcgibin.sh' rm -rf mkmod* mkpag* mkcgibin.sh if [ $? -eq 0 ] then echo Completed else errorexit 'Error while executing rm -rf mkmod* mkpag* mkcgibin.sh' fi echo Only left in $QUIZCOMPOSER: \(executing ls -al in current directory $PWD\) ls -al echo '-------' cd $QUIZCOMPOSER echo Generating new contents in current directory $QUIZCOMPOSER echo Executing tar xpf $INSTALLD/install.tar tar xpf $INSTALLD/install.tar if [ $? -eq 0 ] then echo Completed else errorexit "Error while executing tar xpf $INSTALLD/install.tar" fi echo echo '-------' echo \(Re\)creating $INSTALLD/install.tgz \(excuting gzip $INSTALLD/install.tar\) gzip $INSTALLD/install.tar if [ $? -eq 0 ] then echo Completed else errorexit "Error while executing gzip $INSTALLD/install.tar" fi echo Executing mv $INSTALLD/install.tar.gz $INSTALLD/install.tgz mv $INSTALLD/install.tar.gz $INSTALLD/install.tgz echo echo '-------' cd $QUIZCOMPOSER echo Executing rm -f '*.py' in order to avoid any rogue file '*.py' rm -f '*.py' echo Setting full path to Python interpreter in 1st line of Python-programs for prog in *.py *.d/*.py do echo prog: $prog if [ "$SED" ] then sed "1s+.*+\#!$PYTHON+" $prog > fil mv fil $prog else ed -s $prog > /dev/null < fil mv fil domaindependent.txt else ed -s domaindependent.txt >> /dev/null < Permits.txt < test/password echo Executing chmod $MODE755 $TESTMAILADDRESS chmod $MODE755 $TESTMAILADDRESS if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE755 $TESTMAILADDRESS' echo Could not chmod $MODE755 $TESTMAILADDRESS echo ls -ld $TESTMAILADDRESS results in: ls -ld $TESTMAILADDRESS errorexit fi echo Executing chmod $MODE700 test chmod $MODE700 test if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE700 test' echo Could not chmod $MODE700 test echo ls -ld test results in: ls -ld test errorexit fi echo Executing chmod $MODE600 test/\* chmod $MODE600 test/* if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE600 test/*' echo 'Could not chmod $MODE600 test/*' echo 'ls -ld test/* results in:' ls -ld test/* errorexit fi fi echo Contents of Permits.txt: cat Permits.txt echo Creating Permits.pkl \(executing $PYTHON mkpermitspkl.py\) echo Executing $PYTHON mkpermitspkl.py $PYTHON mkpermitspkl.py if [ $? -eq 0 ] then echo Completed else errorexit "Error while executing $PYTHON mkpermitspkl.py" fi echo Executing ls -ld Permits.pkl ls -ld Permits.pkl echo cd $QUIZCOMPOSER echo Examining existence of directory admin in current directory $PWD if [ -d admin ] then echo Directory admin already exists in $PWD else echo '-------' echo Creating directories for admin adminmailaddress=$ADMINMAILADDRESS echo adminmailaddress: $adminmailaddress echo Executing mkdir $ADMINMAILADDRESS admin mkdir $ADMINMAILADDRESS admin chmod $MODE700 $ADMINMAILADDRESS if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE700 $ADMINMAILADDRESS' echo Could not chmod $MODE700 $ADMINMAILADDRESS echo ls -ld $ADMINMAILADDRESS results in: ls -ld $ADMINMAILADDRESS errorexit fi adminpassword=$ADMINPASSWORD echo Storing value of ADMINPASSWORD in admin/password echo -n $ADMINPASSWORD > admin/password # REINSTALL SYSTEM WHEN PASSWORD LOST chmod $MODE700 admin if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE700 admin' echo Could not chmod $MODE700 admin echo ls -ld admin results in: ls -ld admin errorexit fi chmod $MODE600 admin/* if [ $? -ne 0 ] then echo Current directory: $PWD echo 'Error at statement: chmod $MODE600 admin/*' echo 'Could not chmod $MODE600 admin/*' echo 'ls -ld admin/* results in:' ls -ld admin/* errorexit fi if [ -x "$HTMLDIR/admin" ] then warning "User admin exists already as a file or symbolic link" errorexit "It is not being changed. Check it." else cd $HTMLDIR echo Current directory: $PWD \($HTMLDIR\) echo Creating symbolic link admin to $HTMLDIR2QUIZCOMPOSER$ADMINMAILADDRESS by echo executing ln -s $HTMLDIR2QUIZCOMPOSER$ADMINMAILADDRESS admin ln -s $HTMLDIR2QUIZCOMPOSER$ADMINMAILADDRESS admin cd $QUIZCOMPOSER echo fi fi cd $QUIZCOMPOSER echo '-------' echo Current directory: $PWD echo Please consider checking access rights for installed directories: echo Executing ls -ld test ls -ld test echo Executing ls -ld test/\* ls -ld test/* echo Executing ls -ld $TESTMAILADDRESS/\* if non-empty if [ "`echo $TESTMAILADDRESS/*`" != $TESTMAILADDRESS'/*' ] then ls -ld $TESTMAILADDRESS/* fi echo '-------' cd $QUIZCOMPOSER echo Current directory: $PWD echo Modifying mkmod.py to contain cgi-bin for this domain/server if [ "$SED" ] then sed -e "/cgibin =/s+=.*+= \"$CGIBINDIR/\"+" mkmod.py > fil mv fil mkmod.py else ed -s mkmod.py 2>/dev/null < fil mv fil mod_chkanswer.py else # TODO: check ed -s mod_chkanswer.py 2> /dev/null <MathML) missing; itex.tgz copied in' # before $QUIZCOMPOSER/rqstinst.d is removed, see later cp $QUIZCOMPOSER/rqstinst.d/itex.tgz . echo Current directory: $PWD contains ls -ld itex.tgz if [ -f itex.tgz ] then rm -rf itex tar zxf itex.tgz chmod u+x itex cd itex make echo 'pwd:' pwd echo ls -lrt ls -lrt chmod 750 itex2MML cp itex2MML $CGIBINDIR cd $CGIBINDIR echo ls -ld itex2MML ls -ld itex2MML echo 'pwd:' pwd echo 'rm -rf itex itex.t*' rm -rf itex itex.t* chmod 750 $CGIBINDIR/itex2MML echo itex2MML now in $CGIBINDIR: ls -ld $CGIBINDIR/itex2MML else warning 'LaTeX->MathML compiler itex2MML NOT installed' fi else echo itex2MML was already in $CGIBINDIR: chmod ug+x $CGIBINDIR/itex2MML ls -ld $CGIBINDIR/itex2MML fi echo echo '-------' echo Examining \$GUEST_IPNOCHK: $GUEST_IPNOCHK if [ -n "$GUEST_IPNOCHK" ] then cd $QUIZCOMPOSER/rqstguest.d echo Current directory: $PWD if [ "$SED" ] then sed -e "/CHECK REMOTEADDR/s+for m in acntlst : \# CHECK+if 0 : \# NO CHECK+" mod_rqstguest.py > fil mv fil mod_rqstguest.py else ed -s mod_rqstguest.py 2>/dev/null < cmdfile < fil mv fil reqstdiv.txt else ed -s reqstdiv.txt 2>/dev/null < fil mv fil index.html else # TODO: check ed -s index.html 2>/dev/null <+ /SOURCEFORGE_LOGO END/s+^ ++ /SOURCEFORGE_LOGO END/s+^ ++ /ALLOWGUEST END/s+^ ++ /ALLOWGUEST END/s+^ ++ /ALLOWGUEST END/s+^ ++ /ALLOWGUEST END/s+^ ++ /QUIZCENTER END/s+^ ++ /QUIZCENTER END/s+^ +