예제 #1
0
function postfix()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $daemonbin = $unix->find_program("postconf");
    if (!is_file($daemonbin)) {
        return;
    }
    postfix_logger();
    $f[] = "#!/bin/sh";
    $f[] = "### BEGIN INIT INFO";
    $f[] = "# Provides:          postfix";
    $f[] = "# Required-Start:    \$local_fs \$syslog";
    $f[] = "# Required-Stop:     \$local_fs \$syslog";
    $f[] = "# Should-Start:";
    $f[] = "# Should-Stop:";
    $f[] = "# Default-Start:     2 3 4 5";
    $f[] = "# Default-Stop:      0 1 6";
    $f[] = "# Short-Description: Postfix daemon";
    $f[] = "# chkconfig: 2345 11 89";
    $f[] = "# description: Extensible, configurable Postfix MTA";
    $f[] = "### END INIT INFO";
    $f[] = "case \"\$1\" in";
    $f[] = " start)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.status.php --xmail";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.postfix.php --start \$2 \$3";
    $f[] = "\t exit 0";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = "  stop)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.postfix.php --stop \$2 \$3";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = " restart)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.status.php --xmail";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.postfix.php --restart \$2 \$3";
    $f[] = "\t exit 0";
    $f[] = "    ;;";
    $f[] = "";
    $f[] = " reload)";
    $f[] = "   {$php} " . dirname(__FILE__) . "/exec.postfix.php --reload \$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/postfix";
    echo "freeradius: [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");
    }
}
예제 #2
0
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;}
if($argv[1]=="--postfix-logger"){echo "\n".postfix_logger();exit;}
if($argv[1]=="--mailman"){echo "\n".mailman();exit;}
if($argv[1]=="--kas3"){echo "\n".kas3_milter()."\n".kas3_ap(); exit;}
if($argv[1]=="--samba"){echo "\n".smbd()."\n".nmbd()."\n".winbindd()."\n".scanned_only()."\n"; exit;}
if($argv[1]=="--roundcube"){echo "\n".roundcube();exit;}
if($argv[1]=="--cups"){echo "\n".cups();exit;}
if($argv[1]=="--apache-groupware"){echo "\n".apache_groupware();exit;}
if($argv[1]=="--gdm"){echo "\n".gdm();exit;}
if($argv[1]=="--console-kit"){echo "\n".consolekit();exit;}
if($argv[1]=="--xfce"){echo "\n".xfce();exit;}
if($argv[1]=="--vmtools"){echo "\n".vmtools();exit;}
if($argv[1]=="--hamachi"){echo "\n".hamachi();exit;}
if($argv[1]=="--artica-notifier"){echo "\n".artica_notifier();exit;}
if($argv[1]=="--dhcpd"){echo "\n".dhcpd_server();exit;}
if($argv[1]=="--pure-ftpd"){echo "\n".pure_ftpd();exit;}
if($argv[1]=="--mldonkey"){echo "\n".mldonkey();exit;}
예제 #3
0
    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;
}
if ($argv[1] == "--postfix-logger") {
    echo "\n" . postfix_logger();
    exit;
}
if ($argv[1] == "--mailman") {
    echo "\n" . mailman();
    exit;
}
if ($argv[1] == "--kas3") {
    echo "\n" . kas3_milter() . "\n" . kas3_ap();
    exit;
}
if ($argv[1] == "--samba") {
    echo "\n" . smbd() . "\n" . nmbd() . "\n" . winbindd() . "\n" . scanned_only() . "\n";
    exit;
}
if ($argv[1] == "--roundcube") {