diff options
author | James E. Housley <jeh@FreeBSD.org> | 2006-05-09 12:08:51 +0000 |
---|---|---|
committer | James E. Housley <jeh@FreeBSD.org> | 2006-05-09 12:08:51 +0000 |
commit | e4054d32894d96e3d66d71c4b19a9c360f19521c (patch) | |
tree | e571734fe63ebb3b019d884328ff5592024d4228 /security/vscan/files/update_dat | |
parent | - Update to 1.5.2 (diff) |
Since the DAT files are so short lived on the server, have this port
automatically fetch the current DAT file. The uvscan-dat port will
be removed shortly.
Notes
Notes:
svn path=/head/; revision=161801
Diffstat (limited to 'security/vscan/files/update_dat')
-rw-r--r-- | security/vscan/files/update_dat | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/security/vscan/files/update_dat b/security/vscan/files/update_dat new file mode 100644 index 000000000000..29283944a82e --- /dev/null +++ b/security/vscan/files/update_dat @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $Id$ +# +cd @PREFIX@/libexec/uvscan/ + +# Force a low default and then get the current version's value +cur_AVVER="1" +if [ -f "file_id.diz" ]; then + cur_AVVER="`tail -1 file_id.diz | sed -e 's/^(\(4[0-9]*\)).*$/\1/'`" +fi + +# Find what the website has for the current version +fetch -q http://download.nai.com/products/datfiles/4.x/nai/update.ini || exit 1 +AVVER="`grep DATVersion update.ini | head -1 | cut -f2 -d= | sed -e 's/^\(4[0-9]*\).$/\1/'`" +rm -f update.ini + +# Check to make sure the requested version is "newer" then the current +if [ "$cur_AVVER" -lt "$AVVER" ]; then + for i in *.tar ; do + [ -f "$i" ] && mv $i $i.old + done + fetch -q http://download.nai.com/products/datfiles/4.x/nai/dat-$AVVER.tar || exit 1 + for i in *.dat ; do + [ -f "$i" ] && cp -p $i $i.bak + done + tar xf dat-$AVVER.tar || exit 1 + rm -f *.old + echo "`date` Successfully updated AntiVirus DAT files to $AVVER" +fi +exit 0 |