Пример #1
0
function MAIN_MENU()
{
    $unix = new unix();
    $clear = $unix->find_program("clear");
    if (is_file($clear)) {
        system("{$clear}");
    }
    $php = $unix->LOCATE_PHP5_BIN();
    echo "NETWORK CONFIGURATOR Menu\n";
    echo "---------------------------------------------\n";
    echo "Modify network parameters........: [1]\n";
    echo "Reload/Restart Network...........: [2]\n";
    echo "Stop FireWall....................: [3]\n";
    echo "DNS setup........................: [4]\n";
    echo "Remove NICs Parameters...........: [5]\n";
    echo "Rebuild network setting..........: [6]\n";
    echo "Install Broadcom driver..........: [7]\n";
    echo "Generate a new Unique identifier.: [8]\n";
    echo "Fail-Over........................: [9]\n";
    echo "Exit menu........................: [q]\n";
    echo "\n";
    $answer = trim(strtolower(fgets(STDIN)));
    switch ($answer) {
        case "1":
            ACTION_NETWORK();
            break;
        case "2":
            ACTION_NETWORK_RESTART();
            break;
        case "3":
            ACTION_KILL_IPTABLES();
            break;
        case "4":
            ACTION_DNS();
            break;
        case "5":
            REMOVE_NETWORK();
            break;
        case "6":
            REBUILD_NETWORK();
            break;
        case "7":
            system("{$php} /usr/share/artica-postfix/exec.bnx2.enable.php");
            break;
        case "8":
            new_uuid();
            break;
        case "9":
            fail_over_menu();
            break;
        case "q":
            die;
            break;
        default:
            break;
            MAIN_MENU();
            return;
    }
}
Пример #2
0
    exit;
}
if ($argv[1] == "--savenic") {
    savenic($argv[2]);
    exit;
}
if ($argv[1] == "--savedns") {
    savedns();
    exit;
}
if ($argv[1] == "--reconfigure") {
    reconfigure();
    exit;
}
if ($argv[1] == "--uuid") {
    new_uuid();
    exit;
}
if ($argv[1] == "--stopfw") {
    stopfw();
    exit;
}
$unix = new unix();
$NETWORK_ALL_INTERFACES = $unix->NETWORK_ALL_INTERFACES();
echo "Open you web browser and type:\\n";
while (list($interface, $line) = each($NETWORK_ALL_INTERFACES)) {
    if ($interface == "lo") {
        continue;
    }
    if (trim($line["IPADDR"]) == null) {
        continue;