Пример #1
0
function start_all($aspid = false)
{
    $unix = new unix();
    $sock = new sockets();
    $GLOBALS["TITLENAME"] = $GLOBALS["TITLENAME"] . " ({$ID})";
    if (!$aspid) {
        $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            $time = $unix->PROCCESS_TIME_MIN($pid);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
        @file_put_contents($pidfile, getmypid());
    }
    $unix = new unix();
    $sysctl = $unix->find_program("sysctl");
    $dirs = $unix->dirdir("/etc/vde_switch_config");
    shell_exec_logs("{$sysctl} -w net.ipv4.ip_forward=1 >/dev/null 2>&1");
    while (list($num, $ligne) = each($dirs)) {
        $eth = basename($num);
        $GLOBALS["TITLENAME"] = "Virtual Switch for {$eth}";
        vde_switch($eth);
    }
}
Пример #2
0
    exit;
}
if ($argv[1] == "--stunnel") {
    stunnel();
    exit;
}
if ($argv[1] == "--iscsi") {
    iscsitarget();
    exit;
}
if ($argv[1] == "--milter-greylist") {
    milter_greylist();
    exit;
}
if ($argv[1] == "--vde-switch") {
    vde_switch();
    exit;
}
if ($argv[1] == "--vnstat") {
    vnstat();
    exit;
}
if ($argv[1] == "--rdpproxy") {
    rdpproxy();
    exit;
}
if ($argv[1] == "--rdpproxy-authhook") {
    rdpproxy_authhook();
    exit;
}
if ($argv[1] == "--winbind") {