Updating reports....

Ugo Bellavance ugob at CAMO-ROUTE.COM
Tue Mar 30 04:42:41 IST 2004


>-----Message d'origine-----
>De : James Gray [mailto:james at grayonline.id.au]
>Envoyé : 29 mars, 2004 22:40
>À : MAILSCANNER at JISCMAIL.AC.UK
>Objet : Updating reports....
>
>
>Maybe I've just reinvented the wheel but I was in a hurry :P  Anyway I
>needed to quickly update all the reports we've customised in 
>MS 4.26 so the
>new version (4.28) "looked" the same to our users.
>
>The solution I just hacked basically "diff"'s all the txt/html 
>files in the
>4.26 reports directory against the same file in the new 
>version.  I thought
>this hack might be useful to others, so here it is:
>
>(Is there a better way?!?)

Probably.  If using a rpm-based install, you can usually just watch for .rpmnew files...

>
>#!/usr/local/bin/bash
>
>OLDDIR=/opt/MailScanner/etc/reports/en
>NEWDIR=/opt/MailScanner-4.28.6/etc/reports/en
>
># Check source and destination directories:
>if [ -d $OLDDIR/ ];
>        then
>                echo "Found $OLDDIR - continuing...";
>        else
>                echo "Cant find $OLDDIR - exiting!"
>                exit 0;
>fi
>
>if [ -d $NEWDIR/ ];
>        then
>                echo "Found $NEWDIR - continuing...";
>        else
>                echo "Cant find $NEWIDR - exiting!"
>                exit 0;
>fi
>
>for FILE in `ls $OLDDIR/*.{html,txt}`
>do
>        FOO=`echo $FILE|awk -F/ '{print $NF}'`
>        if [ -e $NEWDIR/$FOO ]; then
>                echo "Patching $FOO"
>                diff $NEWDIR/$FOO $OLDDIR/$FOO > $NEWDIR/$FOO.diff
>                patch $NEWDIR/$FOO $NEWDIR/$FOO.diff
>                echo "";
>        fi
>done
>
>James
>--
>Fortune cookies says:
>Men are those creatures with two legs and eight hands.
>                -- Jayne Mansfield
>




More information about the MailScanner mailing list