----- Original Message -----
From: "Jerry Murdock" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 16, 2002 3:49 AM
Subject: [Declude.Virus] New lower-bandwidth f-prot update script.

> Attached is a new updfprot script using wget instead of ftp.  It does not
> download the files unless they are updated.  It's also marginally smarter
> about unzipping the files and won't even attempt it unless a new file has been
> downloaded.
>
> I use the wget included with cygwin(
www.cygwin.com), but I checked
> compatibility with the non-cygwin Win32 binary at
www.wget.org (follow the
> links) and it seems OK.
>
> As always, it is provided as is with no promises. Use at your own risk. It
> works for me, but may kill your machine, destroy your data,  and end
> civilization as we know it.
>
> Jerry
 
The archived version of the original post shows the attachment in-line and wraps some of the lines.
 
There is no change in the script, only posted via HTML to to prevent wrapping in the archive, along with an attached zip file of the same.
 
Jerry
 
:=====  BEGIN CUT HERE =====
 
rem Update of F-Prot update program to eliminate redundant downloads.
rem Requires info-zip's unzip.exe 5.42 www.info-zip.org
rem Requires gnu wget, links to Windows binaries at www.wget.org or www.cygwin.com
rem Will keep the last three versions of f-prot on disk.
 
SETLOCAL
 
:Set Path Info
SET fprotdrv=f:
SET fprotdir=\vscan\FPROT
SET DownloadDir=%fprotdrv%%fprotdir%\update
 
:Set Unzip Command Info
SET unzipcmd=UNZIP -o -u
SET unziptail=-x f-prot.pif -d %fprotdrv%%fprotdir%
 
:Set FTP Info
SET wgetcmd=c:\cygwin\bin\wget.exe
SET BaseURL=ftp://ftp.f-prot.com/pub
 
:CheckDirectories
md %fprotdrv%%fprotdir%
md %DownloadDir%
if not exist %DownloadDir% goto end
 
:FTPDownload
%wgetcmd% -t 2 -N -nv -P %DownloadDir% %BaseURL%/fp-3*.zip %BaseURL%/fp-def.zip %BaseURL%/macrdef2.zip  2>&1 | find "in 0 files"
if errorlevel 1 goto UnzipFiles
goto end
 
:UnzipFiles
SET T=0
for /F %%I in ('dir %DownloadDir%\fp-3*.zip /a-d-s /b /o:-d') do call :DoNewVersion %DownloadDir%\%%I
%unzipcmd% %DownloadDir%\fp-def.zip %unziptail%
%unzipcmd% %DownloadDir%\macrdef2.zip %unziptail%
 
:Cleanup
attrib -r %DownloadDir%\*.zip
if exist %fprotdrv%%fprotdir%\f-prot.pif del %fprotdrv%%fprotdir%\f-prot.pif
goto end
 
:DoNewVersion
SET /a T = 1+%T%
if %T% EQU 1 %unzipcmd% %1 %unziptail%
if %T% LEQ 3 goto :DoNewVersion_exit
if exist %1 del /F %1 
:DoNewVersion_exit
echo %T%
goto :EOF
 
:END
ENDLOCAL
 
:=====  END CUT HERE =====

Attachment: updfprot2.zip
Description: Binary data

Reply via email to