Here is that same bat file attached as a txt file to avoid the line wraps.
----------BEGIN Batch------- M: cd Imail set RETRY=1 goto Start :Start :: If we have retried 3 times already, notify via email that the download failed. if %RETRY%==4 goto Donebad echo ---------Download attempt %RETRY%--------->>bl_update.log wget http://www.vantekcommunications.com/spam/url-domain-bl.txt -O url-domain-bl.txt.new --cache=off --timeout=60 :: If that worked, then there will be a url-domain-bl.txt.new file. if exist url-domain-bl.txt.new goto Donegood :: If the above test fails, then we increment the retry counter and try agein :: and take no further action. Everything stays as it is. set /a RETRY=%RETRY% + 1 goto Start :: If the test didn't fail we'll replace our file. :Donegood echo %date% %time%: Successfully downloaded url-domain-bl.txt.new after %RETRY% attempt(s)>> bl_update.log if exist url-domain-bl.old del url-domain-bl.old rename url-domain-bl.txt url-domain-bl.old rename url-domain-bl.txt.new url-domain-bl.txt echo %date% %time%: File "url-domain-bl.txt" Replaced Successfully >> bl_update.log blat sendgood.txt -s "[Blacklist updated successfully]" -t [EMAIL PROTECTED] -hostname url-bl.taisweb.net ::Restart the services to make the new list take effect NET STOP SMTPD32 NET STOP QueueMgr NET START SMTPD32 NET START QueueMgr exit :Donebad :: If things went well we're all ok. :: If something went wrong then we'll do a bit of cleanup. echo %date% %time%: Download FAILED!! >> bl_update.log echo %date% %time%: FILE "url-domain-bl.txt" NOT REPLACED! >> bl_update.log blat sendbadl.txt -s "[Blacklist download FAILED!]" -t [EMAIL PROTECTED] -hostname url-bl.taisweb.net exit :: Comment out the following pause when you are sure things are working! pause ----------END Batch---------
