if (preg_match("#--verbose#", implode(" ", $argv))) { $GLOBALS["DEBUG"] = true; $GLOBALS["VERBOSE"] = true; } if (!Build_pid_func(__FILE__, "MAIN")) { writelogs(basename(__FILE__) . ":Already executed.. aborting the process", basename(__FILE__), __FILE__, __LINE__); die; } if (system_is_overloaded()) { events("die, overloaded"); die; } if ($GLOBALS["DEBUG"]) { echo "->DirListsql({$GLOBALS["PARSE_PATH"]})\n"; } $files = DirListsql($GLOBALS["PARSE_PATH"]); $max = count($files); if ($max == 0) { if ($GLOBALS["DEBUG"]) { "max={$max}\n -> die()\n"; } die; } if (!is_array($files)) { if ($GLOBALS["DEBUG"]) { echo "no files\n"; } return null; } events("Parse {$max} sql files in {$GLOBALS["PARSE_PATH"]}"); while (list($num, $file) = each($files)) {
function ScanVirusQueue($q) { $path = "/var/log/artica-postfix/infected-queue"; $files = DirListsql($path); $startedAT = date("Y-m-d H:i:s"); $count = 0; if (!is_array($files)) { events(__FUNCTION__ . " No files.. Aborting\n"); return null; } events("Get sql in {$path} " . count($files) . " files"); while (list($num, $file) = each($files)) { $count = $count + 1; events("ScanVirusQueue():: running {$path}/{$file}"); $q->QUERY_SQL(@file_get_contents("{$path}/{$file}"), "artica_events"); if (!$q->ok) { events("{$path}/{$file} failed"); } else { @unlink("{$path}/{$file}"); } } }
include_once dirname(__FILE__) . "/framework/class.unix.inc"; include_once dirname(__FILE__) . "/framework/frame.class.inc"; cpulimit(); $_GET["LOGFILE"] = "/var/log/artica-postfix/dansguardian-logger.debug"; if (preg_match("#--verbose#", implode(" ", $argv))) { $GLOBALS["debug"] = true; $GLOBALS["VERBOSE"] = true; } if (posix_getuid() != 0) { die("Cannot be used in web server mode\n\n"); } if (!Build_pid_func(__FILE__, "MAIN")) { events(basename(__FILE__) . ": Already executed.. aborting the process"); die; } $files = DirListsql("/var/log/artica-postfix/dansguardian-stats"); $max = count($files); if ($max = 0) { die; } if (!is_array($files)) { events("No files die()"); die; } writelogs("Parse {$max} sql files", "MAIN", __FILE__, __LINE__); $count = 0; while (list($num, $file) = each($files)) { $q = new mysql(); $count = $count + 1; $sql = @file_get_contents("/var/log/artica-postfix/dansguardian-stats/{$file}"); if (trim($sql) == null) {