Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem ----------------------------------------------------------------------
- rem Sanesecurity downloader v0.8 beta for ClamWin/ClamAV (c) Steve Basford
- rem Please see readme.txt
- rem -----------------------------------------------------------------------
- echo.
- echo Sanesecurity downloader for ClamWin/ClamAV...
- echo.
- rem Manually Set the default log location (Examples)
- rem For 64bit: set logloc="%ProgramFiles(x86)%\ClamWin"
- rem For 32bit: set logloc="%ProgramFiles%\ClamWin"
- rem For MailEnable: set logloc="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV"
- set logloc="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV"
- rem quick check for errors
- echo Checking for config errors...
- echo.
- IF NOT EXIST winrsync\rsync.exe echo Warning: Cannot find rsync.exe (winsync\rsync.exe)
- IF NOT EXIST signames.txt echo "Warning: signames.txt not found
- IF NOT EXIST %logloc% echo Warning: log directory not found
- IF NOT EXIST winrsync\rsync.exe goto fin
- IF NOT EXIST signames.txt goto fin
- IF NOT EXIST %logloc% goto fin
- echo.
- echo Config check passed...
- echo.
- rem Manually set ClamWin/ClamAV database path
- rem Example: ClamWin : Set db="%ALLUSERSPROFILE%\.clamwin\db\"
- rem Example: ClamAV : set db="C:\clamav\database"
- rem Example: MailEnable : set db="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV\db\"
- set db="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV\db\"
- rem Automatically obtain the DB directory from the Clamwin.conf file
- rem This will override the above manual setting
- rem DO NOT EDIT ANY OF THE LINES BELOW
- Echo Checking for clamwin.conf
- echo.
- IF EXIST "%appdata%\.clamwin\clamwin.conf" FOR /F "eol=; eol=[ tokens=1,2* delims== " %%i in ('findstr /b /l /i "database"= "%appdata%\.clamwin\clamwin.conf"') DO set db=%%~j
- IF NOT EXIST %db% echo Warning: Database directory not found
- IF NOT EXIST %db% goto fin
- echo Here we go...
- echo.
- echo Started: %date%-%time%
- echo Started: %date%-%time% > %logloc%\sigupdate.log
- echo Downloading files from mirror... >> %logloc%\sigupdate.log
- echo.
- rem grab all Sanesecurity mirrored files
- rem place into dbtemp directory
- SET CYGWIN=nontsec
- rem ### Normal *public* rsync address is: rsync.sanesecurity.net
- rem ### If you have been given a private donators rsync address, replace rsync.sanesecurity.net
- rem ### with your private donators rsync address
- winrsync\rsync.exe >> %logloc%\sigupdate.log --timeout 120 -i -vv -p -z -t rsync://rsync.sanesecurity.net/sanesecurity/* dbtemp
- rem copy only changed files into ClamWin/ClamAV database directory
- echo Copying changed databases into ClamAV database [%db%] directory...
- echo Copying changed databases into ClamAV database [%db%] directory... >> %logloc%\sigupdate.log
- echo.
- for /f "delims=" %%i in (signames.txt) do echo f|xcopy /F /M /Y "dbtemp\%%i" "%db%\%%i*" >> %logloc%\sigupdate.log
- rem echo Reloading ClamD....
- rem echo Reloading ClamD.... >> %logloc%\sigupdate.log
- rem reload clamd databases
- rem net stop clamd
- rem net start clamd
- echo Finished: %date%-%time% >> %logloc%\sigupdate.log
- echo Finished: %date%-%time%
- echo.
- :fin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement