Trend Autoupdate broken in 4.23-10
Daniel Bird
dbird at SGHMS.AC.UK
Mon Sep 1 01:18:00 IST 2003
Dear all,
The trend autoupdate in 4.23-10 is broken. Attached is a fixed version.
Dan
--
____________________________________
Daniel Bird
Network & Systems Manager
St. George's Hospital Medical School
Tooting
London SW17 0RE
P: +44 20 8725 2897
F: +44 20 8725 3583
E: dan at sghms.ac.uk
____________________________________
Hex dump: Where witches put used curses...
"#define QUESTION ((bb) || !(bb)) - Shakespeare."
-------------- next part --------------
#!/bin/sh
# Trend Autoupdate Script.
# V0.1 Dan Bird. dbird at sghms.ac.uk
# 12/08/2003
OPRINI=opr.ini.$$
export OPRINI
# source of IScan dat files
FTPSERV="ftp://ftp.antivirus.com/products/pattern/"
# Get the info on new version...
echo "Checking for latest DAT version..."
wget -q -O /tmp/$OPRINI $FTPSERV/opr.ini
NEWVER=`grep PatternVersion /tmp/opr.ini.$$ | sed s/^PatternVersion=//g | cut -c 1-3`
# What's out current version?
CURRENTVER=`ls /etc/iscan/* | grep lpt | tail -1 | cut -d. -f 2`
if [ "$CURRENTVER" = "" ]
then
CURRENTVER=0
fi
echo "Current version is : $CURRENTVER"
fail () {
trap EXIT
echo "Test run failed -- removing bad Trend data files"
echo "$OUT"
rm -rf /etc/iscan/lpt*$NEWVER*
exit 1
}
# If our current one is older, download the new one!!!
if [ $CURRENTVER -lt $NEWVER ]
then
echo "Getting new DAT version : $NEWVER"
wget -q -P /tmp $FTPSERV/lpt$NEWVER.zip
printf "Testing file for corruption...."
DATCHECK=`unzip -o -t /tmp/lpt$NEWVER.zip | grep "No errors"`
if [ "$DATCHECK" != "" ]
then
echo "OK"
mv /tmp/lpt$NEWVER.zip /etc/iscan
printf "installing...."
cd /etc/iscan
unzip -q -o lpt$NEWVER.zip
echo "DONE"
else
echo "BAD ARCHIVE"
fi
trap fail EXIT
CMD="/opt/trend/ISBASE/IScan.BASE/vscan -v 2>&1"
OUT=`$CMD`
case "$OUT" in
*"read pattern failed"* | \
*"invalid pattern file"* | \
*"pattern file not found"* | \
*"incorrect pattern format"* | \
*"read error"* | \
*"out of memory"* )
fail
;;
esac
trap EXIT
else
echo "DAT files are upto date"
fi
rm -f /tmp/*.zip /tmp/$OPRINI /etc/iscan/*.zip
More information about the MailScanner
mailing list