#!/bin/sh #DEBUG=echo URL=http://ua2.php.net/distributions/manual/php_manual_en.tar.gz CDIR=`pwd` ODIR=$CDIR/php echo Update PHP Manual to directory $ODIR. Current dir $CDIR. echo Source: ${URL} $DEBUG curl -o php_manual_en.tar.gz ${URL} rc=$? if [ $rc = 0 ]; then echo -n "Remove old files... " /bin/rm -rf $ODIR && echo Done.; mkdir $ODIR echo -n "Extract new files to $ODIR..." tar -xzf php_manual_en.tar.gz -C "$ODIR" && echo Done. $DEBUG /bin/rm -f php_manual_en.tar.gz echo -n "Move to the top directory $ODIR... folders... " [ -d $ODIR/html ] && ( cd $ODIR; #mv -f html/figures $ODIR/ && echo -n "Ok. files... " #find html -type f -print0 | xargs -0 -J % mv % $ODIR/ echo -n "Remake files: " find html -type f -print | while read mvname; do ( sed '/<\/div><\/body><\/html>/ d' $mvname ; cat <

Украинская баннерная сеть
EOF echo '' ) > $mvname.tmp mv $mvname.tmp $mvname mv $mvname $ODIR/ echo -n . done /bin/rm -rf $ODIR/html echo Ok. ) || echo Archive format changed. Skip. else echo Bad CURL exit code. Exiting... fi exit