Hello everyone, this is my first post in the forum. I have antivirus update script but for some reason it is not running for some time.
I am getting this message everytime i try to run the updates.
"1 at /usr/local/bin/update-uvscan.pl line 22.
Update file could not be downloaded!"
The script is below. Please help
thanks is advance!
Khan
#!/usr/bin/perl
# written by fox
# to update the virus scanner
# Now includes a rate limit of 2mbit/s (250kbyte/s)
# tmp dir to use (it creates and deletes it. parent directory should exist) no trailing slash
$tmpdir="/tmp/update-virus-scanner";
# ftp site and location of dat files. no trailing slash
$ftpsite="ftp://ftp.mcafee.com/pub/antivirus/datfiles/4.x";
#$ftpsite="http://download.nai.com/products/datfiles/4.x/nai";
# location of the av scanner. no trailing slash
$avscanner="/usr/local/uvscan";
system("rm -rf $tmpdir");
system("mkdir $tmpdir");
system("wget -t2 -T60 --limit-rate=250k --passive-ftp -q -P$tmpdir $ftpsite/update.ini");
open(FILE, "$tmp/dat-update") || die print "Update file could not be downloaded!\n";
$line=<FILE>;
while ($line) {
if ($line =~ "DATVersion") {
($junk, $datversion) = split('=', $line);
}
$line=<FILE>;
}
close(FILE);
$datversion=~s/\cM\n//g;
chomp($datversion);
#print $datversion, "\n";
system("$avscanner/uvscan --version >$tmpdir/ourversion");
open(FILE, "$tmpdir/ourversion") || die print "Could not find current dat version\n";
$line=<FILE>;
while ($line) {
if ($line =~ "Virus data file") {
($junk, $bottom) = split(" v", $line);
($ourversion, $junk) = split(" c", $bottom);
}
$line=<FILE>;
}
close(FILE);
chomp($ourversion);
#print $ourversion, "\n";
if ($datversion > $ourversion) {
system("wget --passive-ftp -q -P$tmpdir $ftpsite/dat-$datversion.zip");
system("unzip -qq $tmpdir/dat-$datversion.zip -d $tmpdir");
system("mv $tmpdir/*.dat $avscanner/");
system("chmod 644 $avscanner/*.dat");
}
system("rm -rf $tmpdir");
Note that I added a '\' at the end of the first line. It is line a continuation
character and means the rest of the command will come up in the following line.