#!/usr/bin/pike #define METHOD_GETS 1 #define METHOD_READLINE 0 static mapping vars = ([ ]); private static string sContext; static int method; /** * * * @param * @return * @author Thomas Bopp (astra@upb.de) * @see */ mixed read_input(string desc, mixed def_value, void|mixed ... values) { Stdio.Readline readln = Stdio.Readline(Stdio.stdin); string str; mixed value; int ok = 0; str = readln->read(desc + " ["+def_value+"]: "); value = def_value; return value; } int main(int argc, array(string) argv) { vars["machine"] = read_input("What's the name of this machine ?", vars["machine"]); vars["sport"] = read_input("What secure port should the sTeam server use ?", vars["sport"]); vars["pop3_port"] = read_input("What port should sTeam use for pop3 ?", vars["pop3_port"]); vars["smtp_port"] = read_input("What port should sTeam use for smtp ?", vars["smtp_port"]); vars["imap_port"] = read_input("What port should sTeam use for IMAP ?", vars["imap_port"]); vars["irc_port"] = read_input("What port should sTeam use for irc ?", vars["irc_port"]); vars["nntp_port"] = read_input("What port should sTeam use for news ?", vars["nntp_port"]); vars["mail_server"] = read_input("What is the name of the mail server ?", vars["mail_server"]); vars["mail_port"] = read_input("At what port can the mailserver be reached at ?", 25); vars["ftp_port"] = read_input("What port should the internal ftp server use ?", 21); vars["mysql_admin"] = read_input("Should a new database be created ?" , "no"); }