예제 #1
0
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . '/ressources/class.dnsmasq.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
include_once dirname(__FILE__) . "/framework/class.settings.inc";
if (preg_match("#--verbose#", implode(" ", $argv))) {
    $GLOBALS["VERBOSE"] = true;
}
if (preg_match("#--force#", implode(" ", $argv))) {
    $GLOBALS["FORCE"] = true;
}
if ($argv[1] == "--simple") {
    execute_mysql($argv[2]);
    exit;
}
execute_mysql(0);
function execute_mysql($OnlyID = 0)
{
    $GLOBALS["INDEXED"] = 0;
    $GLOBALS["SKIPPED"] = 0;
    $GLOBALS["DIRS"] = array();
    $unix = new unix();
    $httrack = $unix->find_program("httrack");
    if (!is_file($httrack)) {
        system_admin_events("httrack no such binary", __FUNCTION__, __FILE__, __LINE__, "webcopy");
        return;
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        system_admin_events("Already instance executed pid:{$olpid}", __FUNCTION__, __FILE__, __LINE__, "webcopy");
예제 #2
0
<?php

include_once dirname(__FILE__) . "/frame.class.inc";
include_once dirname(__FILE__) . "/class.unix.inc";
if (isset($_GET["exec-mysql"])) {
    execute_mysql();
    exit;
}
if (isset($_GET["httptrack"])) {
    httptrack();
    exit;
}
if (isset($_GET["httptrack-id"])) {
    httptrack_simple();
    exit;
}
if (isset($_GET["xapian-db-size"])) {
    localdbsize();
    exit;
}
if (isset($_GET["DeleteDatabasePath"])) {
    DeleteDatabasePath();
    exit;
}
if (isset($_GET["httptrack-progress"])) {
    httptrack_progress();
    exit;
}
writelogs_framework("Unable to understand the query " . @implode(" ", $_GET), __FUNCTION__, __FILE__, __LINE__);
function execute_mysql()
{