"); // // Fichier de paquets apt - date de mise a jour. // $now = getdate(); $updatetime = filemtime("/var/cache/apt/pkgcache.bin"); $update_days = floor(($now[0]-$updatetime)/(3600*24)); // // Base des signatures antivirales // $dailycvd = '/var/lib/clamav/daily.cvd'; $dailycld = '/var/lib/clamav/daily.cld'; if (file_exists($dailycvd)) { $update_virus_time = filemtime($dailycvd); }else{ $update_virus_time = filemtime($dailycld); } // // Statut du paquet CLAMAV // $status = fopen("/var/lib/dpkg/status","r"); $parse_state = "begin"; while (!feof ($status)) { if ($parse_state == "begin") { $buffer = fgets($status,1024); if (preg_match ("/^Package\s*\:\s*clamav\s*/",$buffer)) { $parse_state="version"; } continue; } if ($parse_state == "version") { $buffer = fgets($status,1024); if (preg_match ("/^Version/",$buffer)) { $line_pieces = explode(":",$buffer); $status_version = $line_pieces[1]; $status_version = preg_replace("/^\s*/","",$status_version); $status_version = preg_replace("/\s*\b/","",$status_version); break; } } } fclose($status); $avail = fopen("/var/lib/dpkg/available","r"); $parse_state = "begin"; while (!feof ($avail)) { if ($parse_state == "begin") { $buffer = fgets($avail,1024); if (preg_match ("/^Package\s*\:\s*clamav\s*/",$buffer)) { $parse_state="version"; } continue; } if ($parse_state == "version") { $buffer = fgets($avail,1024); if (preg_match ("/^Version/",$buffer)) { $line_pieces = explode(":",$buffer); $avail_version = $line_pieces[1]; $avail_version = preg_replace("/^\s*/","",$avail_version); $avail_version = preg_replace("/\s*\b/","",$avail_version); break; } } } fclose($avail); ?>
la version installée de clamav est | la version disponible de clamav est |
echo $status_version; ?> | echo $avail_version; ?> |