сорри, вчера последний пост писал с мобилы, комп был недоступен.
сейчас на сервере уже база 6451 , файл
update.ver выглядет вот так :
Спойлер (Отобразить)[ENGINE0]
version=5307 (20100723)
versionid=5307
build=7529
type=engine
level=0
base=268435456
date=23.07.2010
category=engine
platform=x86
group=perseus,ra
buildregname=EngineBuild
file=em002_32_l0.nup
size=24250482
nuv=4.22.1
[ENGINE1]
version=6405 (20110824)
versionid=6405
build=9836
type=engine
level=1
base=7529
date=24.08.2011
category=engine
platform=x86
group=perseus,ra
buildregname=EngineBuild
file=em002_32_l1.nup
size=11398635
nuv=4.22.1
[ENGINE2]
version=6451 (20110909)
versionid=6451
build=9932
type=engine
level=2
base=9836
date=09.09.2011
category=engine
platform=x86
group=perseus,ra
buildregname=EngineBuild
file=em002_32_l2.nup
size=935319
nuv=4.22.1
[ARCHIVES0]
version=1135 (20110802)
versionid=1135
build=1094
type=archives
level=0
base=268435456
date=02.08.2011
category=engine
platform=x86
group=perseus
buildregname=ArchivesBuild
file=em003_32_l0.nup
size=580512
nuv=4.22.1
[ADVHEUR0]
version=1085 (20090112)
versionid=1085
build=1039
type=advheur
level=0
base=268435456
date=12.01.2009
category=engine
platform=x86
group=perseus
buildregname=AdvheurBuild
file=em004_32_l0.nup
size=438663
nuv=4.22.1
[ADVHEUR1]
version=1117 (20110412)
versionid=1117
build=1075
type=advheur
level=1
base=1039
date=12.04.2011
category=engine
platform=x86
group=perseus
buildregname=AdvheurBuild
file=em004_32_l1.nup
size=157079
nuv=4.22.1
[ADVHEUR2]
version=1118 (20110419)
versionid=1118
build=1076
type=advheur
level=2
base=1075
date=19.04.2011
category=engine
platform=x86
group=perseus
buildregname=AdvheurBuild
file=em004_32_l2.nup
size=2869
nuv=4.22.1
[LOADER0]
version=1031 (20091029)
versionid=1031
build=1035
type=loader
level=0
base=268435456
date=29.10.2009
category=engine
platform=x86
group=perseus,epfw,antispam,systemstatus,ra
buildregname=LoaderBuild
file=em000_32_l0.nup
size=49087
nuv=4.22.1
[PERSEUS0]
version=1279 (20100629)
versionid=1279
build=1342
type=perseus
level=0
base=268435456
date=29.06.2010
category=engine
platform=x86
group=perseus,ra
buildregname=PerseusBuild
file=em001_32_l0.nup
size=403308
nuv=4.22.1
[PERSEUS1]
version=1314 (20110801)
versionid=1314
build=1409
type=perseus
level=1
base=1342
date=01.08.2011
category=engine
platform=x86
group=perseus,ra
buildregname=PerseusBuild
file=em001_32_l1.nup
size=196141
nuv=4.22.1
[PERSEUS2]
version=1318 (20110812)
versionid=1318
build=1415
type=perseus
level=2
base=1409
date=12.08.2011
category=engine
platform=x86
group=perseus,ra
buildregname=PerseusBuild
file=em001_32_l2.nup
size=29000
nuv=4.22.1
[CLEANER0]
version=1000 (20070116)
versionid=1000
build=1000
type=cleaner
level=0
base=268435456
date=16.01.2007
category=engine
platform=x86
group=perseus
buildregname=CleanerBuild
file=em005_32_l0.nup
size=29448
nuv=4.22.1
[CLEANER1]
version=1049 (20100604)
versionid=1049
build=1056
type=cleaner
level=1
base=1000
date=04.06.2010
category=engine
platform=x86
group=perseus
buildregname=CleanerBuild
file=em005_32_l1.nup
size=54059
nuv=4.22.1
[CLEANER2]
version=1051 (20110420)
versionid=1051
build=1058
type=cleaner
level=2
base=1056
date=20.04.2011
category=engine
platform=x86
group=perseus
buildregname=CleanerBuild
file=em005_32_l2.nup
size=17758
nuv=4.22.1
[ANTISTEALTH0]
version=1000 (20080514)
versionid=1000
build=1001
type=antistealth
level=0
base=268435456
date=14.05.2008
category=engine
platform=x86
group=perseus
buildregname=AntistealthBuild
file=em006_32_l0.nup
size=10624
nuv=4.22.1
[ANTISTEALTH1]
version=1022 (20100812)
versionid=1022
build=1042
type=antistealth
level=1
base=1001
date=12.08.2010
category=engine
platform=x86
group=perseus
buildregname=AntistealthBuild
file=em006_32_l1.nup
size=97955
nuv=4.22.1
[ANTISTEALTH2]
version=1024 (20101227)
versionid=1024
build=1044
type=antistealth
level=2
base=1042
date=27.12.2010
category=engine
platform=x86
group=perseus
buildregname=AntistealthBuild
file=em006_32_l2.nup
size=10782
nuv=4.22.1
[EPFW0]
version=1068 (20110727)
versionid=1068
build=1098
type=epfw
level=0
base=268435456
date=27.07.2011
category=engine
platform=x86
group=epfw,ra
buildregname=EpfwBuild
file=em008_32_l0.nup
size=242767
nuv=4.22.1
[SYSTEMSTATUS0]
version=1214 (20100127)
versionid=1214
build=1232
type=systemstatus
level=0
base=268435456
date=27.01.2010
category=engine
platform=x86
group=systemstatus
buildregname=SystemstatusBuild
file=em009_32_l0.nup
size=996997
nuv=4.22.1
[SYSTEMSTATUS1]
version=1220 (20110517)
versionid=1220
build=1247
type=systemstatus
level=1
base=1232
date=17.05.2011
category=engine
platform=x86
group=systemstatus
buildregname=SystemstatusBuild
file=em009_32_l1.nup
size=223399
nuv=4.22.1
[SMON0]
version=1013 (20091104)
versionid=1013
build=1019
type=smon
level=0
base=268435456
date=04.11.2009
category=engine
platform=x86
group=antispam
buildregname=SmonBuild
file=em010_32_l0.nup
size=156745
nuv=4.22.1
[SMON1]
version=1016 (20101208)
versionid=1016
build=1022
type=smon
level=1
base=1019
date=08.12.2010
category=engine
platform=x86
group=antispam
buildregname=SmonBuild
file=em010_32_l1.nup
size=108598
nuv=4.22.1
[RA0]
version=1020 (20110119)
versionid=1020
build=1032
type=ra
level=0
base=268435456
date=19.01.2011
category=engine
platform=x86
group=ra
buildregname=RaBuild
file=em011_32_l0.nup
size=976487
nuv=4.22.1
[RA1]
version=1021 (20110128)
versionid=1021
build=1033
type=ra
level=1
base=1032
date=28.01.2011
category=engine
platform=x86
group=ra
buildregname=RaBuild
file=em011_32_l1.nup
size=12393
nuv=4.22.1
[RA2]
version=1022 (20110204)
versionid=1022
build=1034
type=ra
level=2
base=1033
date=04.02.2011
category=engine
platform=x86
group=ra
buildregname=RaBuild
file=em011_32_l2.nup
size=1588
nuv=4.22.1
[SELFDEFENSE0]
version=1000 (20081024)
versionid=1000
build=1015
type=selfdefense
level=0
base=268435456
date=24.10.2008
category=engine
platform=x86
group=perseus
buildregname=SelfdefenseBuild
file=em013_32_l0.nup
size=26145
nuv=4.22.1
[SELFDEFENSE1]
version=1017 (20100728)
versionid=1017
build=1034
type=selfdefense
level=1
base=1015
date=28.07.2010
category=engine
platform=x86
group=perseus
buildregname=SelfdefenseBuild
file=em013_32_l1.nup
size=38454
nuv=4.22.1
[SELFDEFENSE2]
version=1018 (20100812)
versionid=1018
build=1037
type=selfdefense
level=2
base=1034
date=12.08.2010
category=engine
platform=x86
group=perseus
buildregname=SelfdefenseBuild
file=em013_32_l2.nup
size=11522
nuv=4.22.1
[MAILSERVER0]
version=1000 (20090505)
versionid=1000
build=1000
type=mailserver
level=0
base=268435456
date=05.05.2009
category=engine
platform=x86
group=mailserver
buildregname=MailserverBuild
file=em014_32_l0.nup
size=21291
nuv=4.22.1
[MAILSERVER1]
version=1001 (20091022)
versionid=1001
build=1002
type=mailserver
level=1
base=1000
date=22.10.2009
category=engine
platform=x86
group=mailserver
buildregname=MailserverBuild
file=em014_32_l1.nup
size=14906
nuv=4.22.1
[MAILSERVER2]
version=1005 (20100112)
versionid=1005
build=1006
type=mailserver
level=2
base=1002
date=12.01.2010
category=engine
platform=x86
group=mailserver
buildregname=MailserverBuild
file=em014_32_l2.nup
size=12275
nuv=4.22.1
[AMON0]
version=1000 (20090929)
versionid=1000
build=1000
type=amon
level=0
base=268435456
date=29.09.2009
category=engine
platform=x86
group=amon,ra
buildregname=AmonBuild
file=em015_32_l0.nup
size=3315
nuv=4.22.1
[AMON1]
version=1001 (20091118)
versionid=1001
build=1001
type=amon
level=1
base=1000
date=18.11.2009
category=engine
platform=x86
group=amon,ra
buildregname=AmonBuild
file=em015_32_l1.nup
size=1851
nuv=4.22.1
[AMON2]
version=1004 (20100727)
versionid=1004
build=1004
type=amon
level=2
base=1001
date=27.07.2010
category=engine
platform=x86
group=amon,ra
buildregname=AmonBuild
file=em015_32_l2.nup
size=3693
nuv=4.22.1
[LOADER640]
version=1031 (20091029)
versionid=1031
build=1035
type=loader64
level=0
base=268435456
date=29.10.2009
category=engine
platform=x64
group=perseus,epfw,antispam,systemstatus,ra
buildregname=Loader64Build
file=em000_64_l0.nup
size=56412
nuv=4.22.1
[ANTISTEALTH640]
version=1000 (20080514)
versionid=1000
build=1001
type=antistealth64
level=0
base=268435456
date=14.05.2008
category=engine
platform=x64
group=perseus
buildregname=Antistealth64Build
file=em006_64_l0.nup
size=10646
nuv=4.22.1
[ANTISTEALTH641]
version=1024 (20101227)
versionid=1024
build=1044
type=antistealth64
level=1
base=1001
date=27.12.2010
category=engine
platform=x64
group=perseus
buildregname=Antistealth64Build
file=em006_64_l1.nup
size=83376
nuv=4.22.1
[EPFW640]
version=1068 (20110727)
versionid=1068
build=1075
type=epfw64
level=0
base=268435456
date=27.07.2011
category=engine
platform=x64
group=epfw,ra
buildregname=Epfw64Build
file=em008_64_l0.nup
size=308706
nuv=4.22.1
[SYSTEMSTATUS640]
version=1214 (20100127)
versionid=1214
build=1232
type=systemstatus64
level=0
base=268435456
date=27.01.2010
category=engine
platform=x64
group=systemstatus
buildregname=Systemstatus64Build
file=em009_64_l0.nup
size=1196871
nuv=4.22.1
[SYSTEMSTATUS641]
version=1220 (20110517)
versionid=1220
build=1247
type=systemstatus64
level=1
base=1232
date=17.05.2011
category=engine
platform=x64
group=systemstatus
buildregname=Systemstatus64Build
file=em009_64_l1.nup
size=647879
nuv=4.22.1
[SELFDEFENSE640]
version=1000 (20081024)
versionid=1000
build=1015
type=selfdefense64
level=0
base=268435456
date=24.10.2008
category=engine
platform=x64
group=perseus
buildregname=Selfdefense64Build
file=em013_64_l0.nup
size=28673
nuv=4.22.1
[SELFDEFENSE641]
version=1017 (20100728)
versionid=1017
build=1033
type=selfdefense64
level=1
base=1015
date=28.07.2010
category=engine
platform=x64
group=perseus
buildregname=Selfdefense64Build
file=em013_64_l1.nup
size=36492
nuv=4.22.1
[SELFDEFENSE642]
version=1018 (20100812)
versionid=1018
build=1036
type=selfdefense64
level=2
base=1033
date=12.08.2010
category=engine
platform=x64
group=perseus
buildregname=Selfdefense64Build
file=em013_64_l2.nup
size=13172
nuv=4.22.1
[AMON640]
version=1000 (20090929)
versionid=1000
build=1000
type=amon64
level=0
base=268435456
date=29.09.2009
category=engine
platform=x64
group=amon,ra
buildregname=Amon64Build
file=em015_64_l0.nup
size=3427
nuv=4.22.1
[AMON641]
version=1001 (20091118)
versionid=1001
build=1001
type=amon64
level=1
base=1000
date=18.11.2009
category=engine
platform=x64
group=amon,ra
buildregname=Amon64Build
file=em015_64_l1.nup
size=2236
nuv=4.22.1
[AMON642]
version=1004 (20100727)
versionid=1004
build=1004
type=amon64
level=2
base=1001
date=27.07.2010
category=engine
platform=x64
group=amon,ra
buildregname=Amon64Build
file=em015_64_l2.nup
size=3651
nuv=4.22.1
заодно и инструкцию дам. мож проще и каких-нибудь других файлов версию вытащить. а мож и пригодится еще кому.
Создаем зеркало NOD32 в интернете (Отобразить)
создаем файл
functions.php :
CODE:<?php
if(!function_exists("file_put_contents")){
/**
* file_put_contents PHP4 replace
*
* @param string $file
* @param string $data
* @return boolean
*/
function file_put_contents($file,$data){
$fp = fopen($file,"w");
if(!$fp){
return false;
}
fwrite($fp,$data);
fclose($fp);
return true;
}
}
if(!function_exists("file_get_contents")){
/**
* file_put_contents PHP4 replace
*
* @param string $file
* @return mixed
*/
function file_get_contents($file){
$fp = fopen($file,"r");
if(!$fp){
return false;
}
$result = "";
while (!feof($fp)) {
$result .= fread($fp,1024);
}
fclose($fp);
return $result;
}
}
/**
* parses update.ver
*
* @param string $db
* @return array
*/
function parseDB($db){
$result = array();
$last_section = "";
$lines = explode("\n",$db);
foreach ($lines as $line){
$line = trim($line);
if(!empty($line)){
if(@$line[0] == "[" and $line[strlen($line)-1]=="]"){
$last_section = trim($line,"[]");
$result[$last_section] = array();
}else{
@list($var,$val) = explode("=",$line);
$result[$last_section][$var] = $val;
}
}
}
return $result;
}
/**
* Creates update.ver from array
*
* @param unknown_type $arr
* @return unknown
*/
function createDB($arr){
$return = "";
foreach ($arr as $section=>$params){
$return .= "[{$section}]\n";
foreach ($params as $key=>$value){
$return .= "{$key}={$value}\n";
}
}
return $return;
}
/**
* Small function to help parse HTTP Headers
*
* @param unknown_type $array
* @return unknown
*/
function parseHeader($array){
$result = array();
foreach ($array as $value){
if(substr_count($value,":")){
$data = explode(":",$value);
$result[trim($data[0])] = trim($data[1]);
}
}
return $result;
}
/**
* Downloads file from given host
*
* @param string $host HTTP Host
* @param string $file File on host to download
* @param string $save If not empty - save to file
* @param string $user HTTP Auth User
* @param string $password HTTP Auth Password
* @return mixed
*/
function getHTTPFile($host,$file,$save="",$user="",$password=""){
$host = trim(str_replace("http://","",$host),"/");
$data = "";
$last_percent = 0;
$user_password = ($user)?"$user".(($password)?":{$password}":"")."@":"";
$open_url = "http://{$user_password}{$host}/{$file}";
$fp = fopen($open_url,"r",false,stream_context_create(array('http'=>array('user_agent'=>'WGET'))));
if($fp){
if($save){
echo "Creating file {$save}\n";
$sp = fopen($save,"w+",false,stream_context_create(array('ftp' => array('overwrite' => true))));
if(!$sp){
echo "Error: Failed to create file!!!\n"; return false;
}
}
echo "Downloading {$open_url}: ";
$params = stream_get_meta_data($fp);
$params = parseHeader($params['wrapper_data']);
$length = $params['Content-Length'];
while (!feof($fp)) {
$percent = round(ftell($fp)/$length*100);
if($last_percent < $percent and $percent==0){
$last_percent = $percent;
echo "...{$percent}%";
}
if(!isset($sp)){
$data .= fread($fp,128);
}else{
fwrite($sp,fread($fp,128));
}
}
echo "...OK \n";
}else{
echo "Failed to download {$open_url}!!!\n";
}
fclose($fp);
if(!$save){
return $data;
}
fclose($sp);
}
?>
создаем второй файл с именем
update.php
CODE:<?php
define("DEFAULT_SAVE_PATH","/home/html/");//здесь прописываем путь от корня хоста к папке где будет лежать файл update.php
$servers = array(
array('host'=>'http://um13.eset.com/esed_upd/','savepath'=>DEFAULT_SAVE_PATH."nod/"));//сервер откуда будут дергаться базы и папка куда они будут складываться
/**
* Quick & Dirty Script to manage NOD 32 Updates
*
* @author Kode
* @email kode@airnet.ru
* @version 1.1
*
*/
ini_set("display_errors",0);
ini_set("user_agent","WGET");
include("functions.php");
$start = microtime(true);
foreach ($servers as $server){
if(!isset($server['savepath'])){
$server['savepath'] = DEFAULT_SAVE_PATH;
}
if(file_exists($server['savepath']."update.ver"))
$current_db = parseDB(file_get_contents($server['savepath']."update.ver"));
echo "Checking {$server['host']}\n";
$updatedb = parseDB(getHTTPFile($server['host'],"update.ver","",@$server['user'],@$server['password']));
if(!$updatedb){
echo "Invalid server!\n";
continue;
}
foreach ($updatedb as $section=>$vars){
echo "Checking {$section} ({$vars['file']},".@$vars['date'].")\n";
if(!isset($current_db) or ((@$current_db[$section]['versionid'] < @$vars['versionid'] ) or (@$current_db[$section]['build'] < @$vars['build']))){
echo "Obtaining {$vars['file']} (size: {$vars['size']}, verison: {$vars['date']})\n";
getHTTPFile($server['host'],$vars['file'],$server['savepath'].$vars['file'],@$server['user'],@$server['password']);
$current_db[$section] = $vars;
}else{
echo "Also have rather version\n";
}
}
echo "Generation new update.ver\n";
$new_db = createDB($current_db);
echo "Saving new update.ver\n";
file_put_contents($server['savepath']."update.ver",$new_db);
}
echo "Execution time ",round(microtime(true)-$start,4)," sec.";
?>
оба файла заливаем в корень хоста, создаем папку
nod (согласно настроек в файле
update.php) и ставим ей права на запись.
на этом всё. если все прописали правильно - базы будут собираться в указанную вами папку
nod.
запустив файл
site.ru/update.php вы вручную обновите базы. если ваш хостинг имеет функцию планировщика заданий, вы можете настроить автоматическое обновление баз