2003-08-26 17:19:43 +00:00

28 lines
654 B
Bash
Executable File

#!/bin/sh
#
# $OpenBSD: uvscan_update,v 1.4 2003/08/26 17:19:43 jakob Exp $
PATH=/bin:/usr/bin; export PATH
URLBASE=http://download.nai.com/products/datfiles/4.x/nai
FILES="clean.dat internet.dat names.dat scan.dat"
cd @PREFIX@/libexec/uvscan
AVVER=`ftp -o - $URLBASE/readme.txt 2>/dev/null | grep "DAT Version:" | sed -e 's/^.*[^0-9]\(4[0-9]*\)[^0-9].*$/\1/'`
DISTFILE=dat-$AVVER.tar
if [ ! -f $DISTFILE ]; then
ftp $URLBASE/$DISTFILE
if [ -f $DISTFILE ]; then
for i in $FILES ; do
rm -f $i.bak
cp -p $i $i.bak
done
if tar xf dat-$AVVER.tar $FILES ; then
echo `date` Successfully updated AntiVirus DAT files to $AVVER
fi
fi
fi