F-Prot Update Script Available
Tan Siew Wu
siewwu.tan at EDGEMATRIX.COM
Thu Jun 20 08:11:14 IST 2002
On Tue, 18 Jun 2002 17:09:45 +0100, Julian Field <jkf at ECS.SOTON.AC.UK>
wrote:
>Okay, it's written and is available at
>http://www.sng.ecs.soton.ac.uk/mailscanner/files/autoupdate.f-prot
>
Hi Julian,
The script seems to contains a few bugs.. :-)
I just got it down and tried it. It works but it was getting the file
from the $FallbackServer. I notice this when I look at the squid cache log
file. There is an entry with URL "GET http://fp-def.zip/".
After carefully looking through the script, seems that
$Server variable may not be defined anywhere, it should be $server?
#####################################
.
# Download it from the server
DownloadFile($Server, $FileToCheck);
.
sub DownloadFile {
my($host, $file) = @_;
my($result);
if ($file =~ /^SIGN/) {
.
Fetch($host, 'fp-def.zip');
.
} else {
.
Fetch($host, 'macrdef2.zip');
.
}
}
sub Fetch {
my($ip, $filename) = @_;
my($r);
$r = system("wget --passive-ftp --tries=3 $ip$filename > /dev/null 2>&1");
if ($r>>8) {
# Download failed so try fallback server
BailOut("Download from $ip failed, exiting.") if $ip eq $FallbackServer;
Fetch($FallbackServer, $filename);
}
}
###### Squid cache log ######
.... TCP_MISS/200 778 GET http://updates.f-prot.com/cgi-bin/check-updates? -
DIRECT/updates.f-prot.com text/plain
.... TCP_MISS/503 1147 GET http://fp-def.zip/ - DIRECT/fp-def.zip -
.... TCP_MISS/200 943963 GET http://updates.f-prot.com/files/fp-def.zip -
DIRECT/updates.f-prot.com application/zip
More information about the MailScanner
mailing list