:===== BEGIN CUT HERE =====
rem Updates a Mcafee *! COMMAND LINE !* scanner installation with
latest
rem engine and daily dat files.
rem WARNING:
rem NAI considers the daily dat files BETA quality.
Use at your own risk.
rem WARNING:
rem NAI could change the behavior of the SuperDAT packages
at any time,
rem rendering this script useless or even dangerous.
rem WARNING:
rem This is *NOT* designed to update a running
on-access/real-time scanner
rem installation. If using Netshield or
VirusScan on-access/real-time
rem scanners, create a separate directory for
the command line functionality.
rem
rem Alternatively, it is possible to
use the same techniques to automate
rem updating of the real-time
Netshield/VirusScan. Get SDATDAILY.exe instead
rem of DAILIYDAT.ZIP,
and look at the sdat command line switches to install
rem the sdat(s)
silently. Proceed with caution, and test all possible
rem scenarios.
An SDAT updating a running Netshield may want to reboot (more
rem likely for
the "release" sdat41## file, probably not an issue for
rem sdatdaily).
Proceed with caution.
rem This script is distributed in the hope that it will be useful,
rem
but WITHOUT ANY WARRANTY; without even the implied warranty of
rem
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rem
rem USE
AT YOUR OWN RISK!
SETLOCAL
:Set Path Info
SET scandrv=f:
SET scandir=\vscan\McAfee
SET
DownloadDir=%scandrv%%scandir%\update
SET
SDATLog=%DownloadDir%\SDAT.LOG
:Set Unzip Command Info
SET unzipcmd=UNZIP -o -u
SET unziptail=-d
%scandrv%%scandir%
:CheckDirectories
md %scandrv%%scandir%
md %DownloadDir%
if not
exist %DownloadDir% goto end
:Set FTP Info
:FOR WGET 1.7
!*************************************************!
SET
wgetcmd=c:\cygwin\bin\wget.exe
:FOR WGET 1.8 OR GREATER
!**************************************!
:SET wgetcmd=c:\cygwin\bin\wget.exe
--progress=dot
SET SDATURL=ftp://ftp.nai.com/pub/antivirus/datfiles/4.x/sdat*.exe
SET
DDATURL=http://download.nai.com/products/mcafee-avert/daily_dats/DAILYDAT.ZIP
SET NewSDAT=1
SET NewDDAT=1
:FTPDownload
%wgetcmd% -t 2 -N -P %DownloadDir% %SDATURL% 2>&1 |
find "100%%"
if errorlevel 1 SET NewSDAT=0
%wgetcmd% -t 2 -N -P %DownloadDir% %DDATURL% 2>&1 | find
"100%%"
if errorlevel 1 SET NewDDAT=0
if %NewSDAT%==1 goto ProcessSDAT
if %NewDDAT%==1 %unzipcmd%
%DownloadDir%\DAILYDAT.zip %unziptail%
goto end
:ProcessSDAT
SET T=0
for /F %%I in ('dir %DownloadDir%\sdat4*.exe
/a-d-s /b /o:-n') do call :RunSDAT %DownloadDir%\%%I
%unzipcmd%
%DownloadDir%\DAILYDAT.zip %unziptail%
del %SDATLog%
goto END
:RunSDAT
SET /a T = 1+%T%
if %T% EQU 1 start /wait %1 -logfile
%SDATLog% -e %scandrv%%scandir%
if %T% LEQ 3 goto :RunSDAT_exit
if exist
%1 del /F %1
:RunSDAT_exit
goto :EOF
:END
ENDLOCAL