|
From: Michael G. I. <mge...@wn...> - 2002-01-12 01:41:51
|
All, This is a little off topic, but if you are using Amavis with McAfee (like I am), you have to periodically download the new virus image DAT file. According to McAfee support, DAT files come out once per week (Usually Wednesday by Noon). This script checks for the file with the next highest serial number, thus you can run it as often as you desire with minimal impact to your network or McAfee's web server. (I plan to check once every 12 hours). Anyway, you might find this useful, you might not. Either way I invested a little time and thought on this problem and it could potentially save you time. This script requires "wget" to be installed on your server. If you end up using it, drop me an email and I will send you any changes/revisions as I learn more about DAT file releases. -Michael George III mge...@wn... ----- start of "download_new_dat.sh" ------ #!/bin/sh # Directory Setup DAT_FILE_DIR=/usr/local/mcafee DAT_ARCHIVE_DIR=/usr/local/mcafee/archive WORK_DIR=/usr/local/mcafee/tmp SERIAL_NUMBER_FILE=/usr/local/mcafee/dat/lastserialno EMAIL_NOTIFY=Your_Email_Address_Here@your_domain.com # Directory Structure # # /usr/local/mcafee + <- uvscan and DAT files # | # + archive <- Archived DAT files # + bin <- decompressions utils # + dat <- this script, lastserialno file # + tmp <- temp directory # # Notes: # According to McAfee support, the virus DAT files are released # every Wednesday, unless of course an emergency occurs. # In cases of emergency ( a fast spreading virus) # DAT files will be released on the day of the outbreak. # # Each time a DAT file is released the number # of the serial number in incremented. The prior 15 # DAT files also remain available, even though the # DAT files are cumulative. cd $WORK_DIR if [ ! -f $SERIAL_NUMBER_FILE ] then echo " " echo "==================================================================" echo "ERROR - file $SERIAL_NUMBER_FILE missing. Exiting..." echo "==================================================================" echo "To correct this problem create the file '$SERIAL_NUMBER_FILE'" echo "and put the serial number of your most recent DAT file in this file." echo " " echo "Example:" echo "If dat-4180.tar is your most recent DAT file, put 4180 in this file." echo " " exit 1 fi LAST_SERIAL=`cat $SERIAL_NUMBER_FILE` CURR_SERIAL=`expr $LAST_SERIAL + 1` # Get the latest DAT file #http://www.nai.com/naicommon/download/dats/mcafee_4x.asp wget -N http://a64.g.akamai.net/7/64/2015/2002-01-09-10-30-01-767/download.nai.com/p roducts/datfiles/4.x/nai/dat-$CURR_SERIAL.tar # wget exit status 0 = we got DAT file # wget exit status 1 = no new DAT file dat_status=$? if [ $dat_status -eq 0 ] then echo "New DAT file detected, installing and updating serial number." # Unpack DAT file tar xvf dat-$CURR_SERIAL.tar # Copy news DAT files to mcafee uvscan dir cp *.dat $DAT_FILE_DIR mv dat-$CURR_SERIAL.tar $DAT_ARCHIVE_DIR/dat-$CURR_SERIAL.tar mail -s "Virus Update: New DAT File News ($CURR_SERIAL)" $EMAIL_NOTIFY < readme.txt #Update Serial Number File w/ Incremented Serial Number echo $CURR_SERIAL > $SERIAL_NUMBER_FILE fi if [ $dat_status -eq 1 ] then echo "No New DAT file detected, exiting ..." mail -s "Virus Update: No New DAT File Available Today ($LAST_SERIAL)" $EMAIL_NOTIFY < readme.txt fi |