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;
    }
}
function MAIN_MENU()
{
    $unix = new unix();
    $clear = $unix->find_program("clear");
    if (is_file($clear)) {
        system("{$clear}");
    }
    echo "MetaClient Menu\n";
    echo "---------------------------------------------\n";
    echo "Join to a Meta server............: [1]\n";
    echo "Ping the Meta server.............: [2]\n";
    echo "Exit menu........................: [q]\n";
    echo "\n";
    $answer = trim(strtolower(fgets(STDIN)));
    switch ($answer) {
        case "1":
            ACTION_JOIN();
            break;
        case "2":
            ACTION_PING();
            break;
        case "3":
            ACTION_KILL_IPTABLES();
            break;
        case "4":
            ACTION_DNS();
            break;
        case "5":
            REMOVE_NETWORK();
            break;
        case "6":
            REBUILD_NETWORK();
            break;
        case "q":
            die;
            break;
        default:
            break;
            MAIN_MENU();
            return;
    }
}