die;
}
if ($argv[1] == "--reprocess-database") {
    updatev2($argv[2]);
    die;
}
if ($argv[1] == "--fullupdate") {
    updatev2();
    die;
}
if ($argv[1] == "--schedule-maintenance") {
    schedulemaintenance();
    die;
}
if ($argv[1] == "--categorize-delete") {
    categorize_delete();
    die;
}
if ($argv[1] == "--v2") {
    updatev2();
    die;
}
if ($argv[1] == "--v2-index") {
    updatev2_index();
    die;
}
if ($argv[1] == "--cicap") {
    C_ICAP_TABLES();
    die;
}
if ($argv[1] == "--ufdb-first") {
Esempio n. 2
0
function update()
{
    $myDate = GetLastUpdateDate();
    echo "BLACKLISTS: Last update on {$myDate}\n";
    $unix = new unix();
    $curl = new ccurl("http://www.artica.fr/blacklist/update.ini");
    if (!$curl->GetFile("/tmp/update.ini")) {
        ufdbguard_admin_events("Fatal: unable to download blacklist index file {$curl->error}", __FUNCTION__, __FILE__, __LINE__, "update");
        echo "BLACKLISTS: Failed to retreive http://www.artica.fr/blacklist/update.ini ({$curl->error})\n";
        return;
    }
    $ini = new Bs_IniHandler("/tmp/update.ini");
    $date = $ini->_params["settings"]["date"];
    echo "BLACKLISTS: Pattern update {$date}\n";
    if (!$GLOBALS["FORCE"]) {
        if ($date == $myDate) {
            echo "BLACKLISTS: No new updates\n";
            return;
        }
    }
    categorize_delete();
    while (list($category, $array) = each($ini->_params)) {
        echo "Saving {$category}\n";
        while (list($filename, $size) = each($array)) {
            if (!is_numeric($size)) {
                $size = 0;
            }
            echo "Saving {$filename} for {$category}\n";
            if (!INITCategory($category, $date, $filename, $size)) {
                echo "Fatal error {$category} {$date} {$filename} {$size}\n";
                return;
            }
        }
    }
}