Advertisement
Sanesecurity

test

Mar 9th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. @echo off
  2.  
  3. rem ----------------------------------------------------------------------
  4. rem Sanesecurity downloader v0.8 beta for ClamWin/ClamAV (c) Steve Basford
  5. rem Please see readme.txt
  6. rem -----------------------------------------------------------------------
  7.  
  8. echo.
  9. echo Sanesecurity downloader for ClamWin/ClamAV...
  10. echo.
  11.  
  12. rem Manually Set the default log location (Examples)
  13. rem For 64bit: set logloc="%ProgramFiles(x86)%\ClamWin"
  14. rem For 32bit: set logloc="%ProgramFiles%\ClamWin"
  15. rem For MailEnable: set logloc="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV"
  16.  
  17. set logloc="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV"
  18.  
  19. rem quick check for errors
  20. echo Checking for config errors...
  21. echo.
  22.  
  23. IF NOT EXIST winrsync\rsync.exe echo Warning: Cannot find rsync.exe (winsync\rsync.exe)
  24. IF NOT EXIST signames.txt echo "Warning: signames.txt not found
  25. IF NOT EXIST %logloc% echo Warning: log directory not found
  26.  
  27. IF NOT EXIST winrsync\rsync.exe goto fin
  28. IF NOT EXIST signames.txt goto fin
  29. IF NOT EXIST %logloc% goto fin
  30.  
  31. echo.
  32. echo Config check passed...
  33. echo.
  34.  
  35. rem Manually set ClamWin/ClamAV database path
  36.  
  37. rem Example: ClamWin : Set db="%ALLUSERSPROFILE%\.clamwin\db\"
  38. rem Example: ClamAV : set db="C:\clamav\database"
  39. rem Example: MailEnable : set db="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV\db\"
  40.  
  41. set db="%ProgramFiles(x86)%\Mailen~1\Antivi~1\ClamAV\db\"
  42.  
  43. rem Automatically obtain the DB directory from the Clamwin.conf file
  44. rem This will override the above manual setting
  45. rem DO NOT EDIT ANY OF THE LINES BELOW
  46.  
  47. Echo Checking for clamwin.conf
  48. echo.
  49.  
  50. 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
  51.  
  52. IF NOT EXIST %db% echo Warning: Database directory not found
  53. IF NOT EXIST %db% goto fin
  54.  
  55. echo Here we go...
  56. echo.
  57.  
  58. echo Started: %date%-%time%
  59. echo Started: %date%-%time% > %logloc%\sigupdate.log
  60. echo Downloading files from mirror... >> %logloc%\sigupdate.log
  61. echo.
  62.  
  63. rem grab all Sanesecurity mirrored files
  64. rem place into dbtemp directory
  65. SET CYGWIN=nontsec
  66.  
  67. rem ### Normal *public* rsync address is: rsync.sanesecurity.net
  68. rem ### If you have been given a private donators rsync address, replace rsync.sanesecurity.net
  69. rem ### with your private donators rsync address
  70.  
  71. winrsync\rsync.exe >> %logloc%\sigupdate.log --timeout 120 -i -vv -p -z -t rsync://rsync.sanesecurity.net/sanesecurity/* dbtemp
  72.  
  73. rem copy only changed files into ClamWin/ClamAV database directory
  74. echo Copying changed databases into ClamAV database [%db%] directory...
  75. echo Copying changed databases into ClamAV database [%db%] directory... >> %logloc%\sigupdate.log
  76. echo.
  77.  
  78. for /f "delims=" %%i in (signames.txt) do echo f|xcopy /F /M /Y "dbtemp\%%i" "%db%\%%i*" >> %logloc%\sigupdate.log
  79.  
  80. rem echo Reloading ClamD....
  81. rem echo Reloading ClamD.... >> %logloc%\sigupdate.log
  82. rem reload clamd databases
  83. rem net stop clamd
  84. rem net start clamd
  85.  
  86. echo Finished: %date%-%time% >> %logloc%\sigupdate.log
  87. echo Finished: %date%-%time%
  88. echo.
  89.  
  90. :fin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement