aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorjeh <jeh@FreeBSD.org>2005-10-05 00:38:25 +0800
committerjeh <jeh@FreeBSD.org>2005-10-05 00:38:25 +0800
commit295e6534087e2b4973ea49e9179be5190709b59b (patch)
tree80dd2151cdcf3111901241cb9fdaa2c2fa5a95f4 /security
parent89eaede6652d613a62b74643477e82079cb5f0bc (diff)
downloadfreebsd-ports-gnome-295e6534087e2b4973ea49e9179be5190709b59b.tar.gz
freebsd-ports-gnome-295e6534087e2b4973ea49e9179be5190709b59b.tar.zst
freebsd-ports-gnome-295e6534087e2b4973ea49e9179be5190709b59b.zip
Update update_dat to use fetch and be a little more robust. Thanks to
Sztankay Zsolt for the work.
Diffstat (limited to 'security')
-rw-r--r--security/uvscan-dat/files/update_dat30
1 files changed, 14 insertions, 16 deletions
diff --git a/security/uvscan-dat/files/update_dat b/security/uvscan-dat/files/update_dat
index 41b6d826b7b7..29283944a82e 100644
--- a/security/uvscan-dat/files/update_dat
+++ b/security/uvscan-dat/files/update_dat
@@ -6,28 +6,26 @@ 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/'`
+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
-ftp http://download.nai.com/products/datfiles/4.x/nai/update.ini >/dev/null
-AVVER=`grep DATVersion update.ini | head -1 | cut -f2 -d= | sed -e 's/^\(4[0-9]*\).$/\1/'`
+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
- mv $i $i.old
+ [ -f "$i" ] && mv $i $i.old
done
- if ftp http://download.nai.com/products/datfiles/4.x/nai/dat-$AVVER.tar >/dev/null ; then
- for i in *.dat ; do
- cp -p $i $i.bak
- done
- if tar xf dat-$AVVER.tar ; then
- rm -f *.old
- echo `date` Successfully updated AntiVirus DAT files to $AVVER
- fi
- else
- rm -f dat-$AVVER.tar
- fi
+ 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