Beispiel #1
0
function pdns()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $daemonbin = $unix->find_program("pdns_server");
    if (!is_file($daemonbin)) {
        return;
    }
    $f[] = "#!/bin/sh";
    $f[] = "### BEGIN INIT INFO";
    $f[] = "# Provides:          pdns";
    $f[] = "# Required-Start:    \$local_fs \$syslog \$network \$time";
    $f[] = "# Required-Stop:     \$local_fs";
    $f[] = "# Should-Start:";
    $f[] = "# Should-Stop:";
    $f[] = "# Default-Start:     2 3 4 5";
    $f[] = "# Default-Stop:      0 1 6";
    $f[] = "# Short-Description: PowerDNS daemon";
    $f[] = "# chkconfig: 2345 11 89";
    $f[] = "# description: Extensible, configurable DNS PROXY daemon";
    $f[] = "### END INIT INFO";
    $f[] = "case \"\$1\" in";
    $f[] = " start)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.pdns_server.php --start \$2 \$3";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.pdns.php --poweradmin \$2 \$3";
    $f[] = "\t exit 0";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = "  stop)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.pdns_server.php --stop \$2 \$3";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = " restart)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.pdns_server.php --restart \$2 \$3";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.pdns.php --poweradmin \$2 \$3";
    $f[] = "\t exit 0";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = " reload)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.pdns_server.php --restart \$2 \$3";
    $f[] = "\t exit 0";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = "  *)";
    $f[] = "    echo \"Usage: \$0 {start|stop|restart} (+ '--verbose' for more infos)\"";
    $f[] = "    exit 1";
    $f[] = "    ;;";
    $f[] = "esac";
    $f[] = "exit 0\n";
    $INITD_PATH = "/etc/init.d/pdns";
    echo "PDNS: [INFO] Writing {$INITD_PATH} with new config\n";
    @unlink($INITD_PATH);
    @file_put_contents($INITD_PATH, @implode("\n", $f));
    @chmod($INITD_PATH, 0755);
    if (is_file('/usr/sbin/update-rc.d')) {
        shell_exec("/usr/sbin/update-rc.d -f " . basename($INITD_PATH) . " defaults >/dev/null 2>&1");
    }
    if (is_file('/sbin/chkconfig')) {
        shell_exec("/sbin/chkconfig --add " . basename($INITD_PATH) . " >/dev/null 2>&1");
        shell_exec("/sbin/chkconfig --level 345 " . basename($INITD_PATH) . " on >/dev/null 2>&1");
    }
    pdns_recursor();
}
Beispiel #2
0
if($argv[1]=="--all"){
	events("-> launch_all_status()","MAIN",__LINE__);
	launch_all_status();
	die();
}
if($argv[1]=="--free"){echo getmem();exit;}
if($argv[1]=="--squid"){echo squid_master_status();exit;}
if($argv[1]=="--c-icap"){echo c_icap_master_status();exit;}
if($argv[1]=="--kav4proxy"){echo kav4Proxy_status();exit;}
if($argv[1]=="--dansguardian"){echo dansguardian_master_status();exit;}
if($argv[1]=="--wifi"){echo wpa_supplicant();;exit;}
if($argv[1]=="--fetchmail"){echo fetchmail();;exit;}
if($argv[1]=="--milter-greylist"){echo milter_greylist();;exit;}
if($argv[1]=="--framework"){echo framework();;exit;}
if($argv[1]=="--pdns"){echo pdns_server()."\n".pdns_recursor();exit;}
if($argv[1]=="--cyrus-imap"){echo cyrus_imap();exit;}
if($argv[1]=="--mysql"){echo "\n".mysql_server()."\n".mysql_mgmt()."\n". mysql_replica();exit;}
if($argv[1]=="--openldap"){echo "\n".openldap();;exit;}
if($argv[1]=="--saslauthd"){echo "\n".saslauthd();;exit;}
if($argv[1]=="--sysloger"){echo "\n".syslogger();;exit;}
if($argv[1]=="--squid-tail"){echo "\n".squid_tail();;exit;}
if($argv[1]=="--amavis"){echo "\n".amavis();exit;}
if($argv[1]=="--amavis-milter"){echo"\n". amavis_milter();exit;}
if($argv[1]=="--boa"){echo"\n". boa();exit;}
if($argv[1]=="--lighttpd"){echo"\n". lighttpd();exit;}
if($argv[1]=="--fcron"){echo"\n". fcron1()."\n".fcron2(); exit;}
if($argv[1]=="--clamav"){echo"\n". clamd()."\n".clamscan()."\n".clammilter()."\n".freshclam(); exit;}
if($argv[1]=="--retranslator"){echo"\n". retranslator_httpd(); exit;}
if($argv[1]=="--spamassassin"){echo spamassassin_milter()."\n".spamassassin();exit;}
if($argv[1]=="--postfix"){echo "\n".postfix();exit;}
Beispiel #3
0
    exit;
}
if ($argv[1] == "--fetchmail") {
    echo fetchmail();
    exit;
}
if ($argv[1] == "--milter-greylist") {
    echo milter_greylist();
    exit;
}
if ($argv[1] == "--framework") {
    echo framework();
    exit;
}
if ($argv[1] == "--pdns") {
    echo pdns_server() . "\n" . pdns_recursor();
    exit;
}
if ($argv[1] == "--cyrus-imap") {
    echo cyrus_imap();
    exit;
}
if ($argv[1] == "--mysql") {
    echo "\n" . mysql_server() . "\n" . mysql_mgmt() . "\n" . mysql_replica();
    exit;
}
if ($argv[1] == "--openldap") {
    echo "\n" . openldap();
    exit;
}
if ($argv[1] == "--saslauthd") {