You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getRulebase.cmd 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @ECHO OFF
  2. SETLOCAL
  3. REM ----- Edit This Section --------
  4. SET SNIFFER_PATH=c:\SNF
  5. SET AUTHENTICATION=authenticationxx
  6. SET LICENSE_ID=licensid
  7. REM --------------------------------
  8. CD /d %SNIFFER_PATH%
  9. echo Running SNF getRulebase.cmd > getRulebase.txt
  10. if not exist UpdateReady.txt echo No UpdateReady.txt >> getRulebase.txt
  11. if not exist UpdateReady.txt goto DONE
  12. REM The next line may cause trouble if your system stops while this
  13. REM script is running. It is not needed when this script is run
  14. REM from SNF's <update-script/> feature since only one copy will run
  15. REM at a time. However, if you are going to run a version of this
  16. REM script as a scheduled task you will want to uncomment the next
  17. REM line to make sure only one copy runs at a time-- just be sure to
  18. REM clean out any stale .lck files after a restart.
  19. REM if exist UpdateReady.lck echo getRulebase.cmd locked/running >> getRulebase.txt
  20. REM if exist UpdateReady.lck goto DONE
  21. :DOWNLOAD
  22. copy UpdateReady.txt UpdateReady.lck > nul
  23. if exist %LICENSE_ID%.new del %LICENSE_ID%.new
  24. echo.
  25. curl -v "http://www.sortmonster.net/Sniffer/Updates/%LICENSE_ID%.snf" -o %LICENSE_ID%.new -S -R -z %LICENSE_ID%.snf -H "Accept-Encoding:gzip" --compressed -u sniffer:ki11sp8m 2>> getRulebase.txt
  26. if %ERRORLEVEL% NEQ 0 del %LICENSE_ID%.new 2> nul
  27. if not exist %LICENSE_ID%.new echo New rulebase file NOT downloaded >> getRulebase.txt
  28. if not exist %LICENSE_ID%.new goto CLEANUP
  29. snf2check.exe %LICENSE_ID%.new %AUTHENTICATION% 2>> getRulebase.txt
  30. if errorlevel 1 goto CLEANUP
  31. echo New rulebase file tested OK >> getRulebase.txt
  32. if exist %LICENSE_ID%.old del %LICENSE_ID%.old
  33. if exist %LICENSE_ID%.snf rename %LICENSE_ID%.snf %LICENSE_ID%.old
  34. rename %LICENSE_ID%.new %LICENSE_ID%.snf
  35. if exist UpdateReady.txt del UpdateReady.txt
  36. if exist UpdateReady.lck del UpdateReady.lck
  37. :CLEANUP
  38. if exist %LICENSE_ID%.new del %LICENSE_ID%.new
  39. if exist UpdateReady.lck del UpdateReady.lck
  40. :DONE
  41. echo Done >> getRulebase.txt
  42. REM This is a good place to add a line that will email getrulebase.txt to
  43. REM yourself so that you know what just happened.
  44. ENDLOCAL