Ejemplo n.º 1
0
function xreset()
{
    system("clear");
    echo "Warning all data will be erased..\n";
    echo "Type Y key if your are agree or Q to exit\n";
    $answer = trim(strtolower(fgets(STDIN)));
    if ($answer == "q") {
        die(0);
    }
    if ($answer == "y") {
        reset2();
        return;
    }
    xtsart();
}
Ejemplo n.º 2
0
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
if (preg_match("#--verbose#", implode(" ", $argv))) {
    $GLOBALS["VERBOSE"] = true;
    $GLOBALS["DEBUG_INFLUX"] = true;
    $GLOBALS["VERBOSE"] = true;
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
}
if ($argv[1] == "rxtx") {
    RXTX();
    exit;
}
xtsart();
function xtsart()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".pid";
    $pidTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".time";
    if ($GLOBALS["VERBOSE"]) {
        echo "TimeFile:{$pidTime}\n";
    }
    $unix = new unix();
    if (!$GLOBALS["VERBOSE"]) {
        if ($unix->file_time_min($pidTime) < 10) {
            die;
        }
        if ($unix->process_exists(@file_get_contents($pidfile, basename(__FILE__)))) {
            if ($GLOBALS["VERBOSE"]) {