6 &GetOptions
("clustername:s", "dbuser:s", "host:s", "dbservice:s", "help");
9 print "Usage: $0 [OPTION]...\n";
11 print " --clustername=<clustername> create default.cfg using <clustername> as the cluster name\n";
12 print " --dbuser=<db user id> use <db user id> to id the server\n";
13 print " --host:<hostname> create a default.cfg that uses <hostname> for server addresses\n";
14 print " --dbservice:<db server> use <db server> (e.g. from tnsnames)\n";
15 print "\nBy default, the script will try to generate a default.cfg using reasonable defaults.\n";
19 my $hostname = hostname
();
22 $hostname=$::opt_host
;
25 my $dbuser = getpwuid($<);
29 $dbuser = $::opt_dbuser
;
34 @dirs = split('/', $Bin);
40 $branch = @dirs[$x+1];
46 $dbuser = "$dbuser\_$branch";
49 my $dbservice="swodb";
52 $dbservice = $::opt_dbservice
;
55 my $clustername = getpwuid($<);
56 if($::opt_clustername
)
58 $clustername = $::opt_clustername
;
62 my $hostip = inet_ntoa
(inet_aton
($hostname));
64 open (CONFIG
, "> default.cfg") or die "Could not open default.cfg for writing\n";
65 print CONFIG
"[TaskManager]\n";
66 print CONFIG
"loginServerAddress=aus-lindevlogin-01.starwarsgalaxies.net\n";
67 print CONFIG
"clusterName=$clustername\n";
68 print CONFIG
"node0=$hostip\n\n";
69 print CONFIG
"[dbProcess]\n";
70 print CONFIG
"DSN=$dbservice\n";
71 print CONFIG
"databaseUID=$dbuser\n\n";
72 print CONFIG
"[LoginServer]\n";
73 print CONFIG
"DSN=$dbservice\n";
74 print CONFIG
"databaseUID=$dbuser\n";
75 print CONFIG
"developmentMode=true\n";
76 print CONFIG
"\n[CentralServer]\n";
77 print CONFIG
"developmentMode=true\n";
78 print CONFIG
"\n[GameServer]\n";
79 print CONFIG
"adminGodToAll=true\n";
83 if(! open(TMRC
, "<taskmanager.rc"))
85 open(TMRC
, ">taskmanager.rc") or die "could not open taskmanager.rc for writing\n";
86 print TMRC
"CentralServer local debug/CentralServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
87 print TMRC
"ConnectionServer local debug/ConnectionServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
88 print TMRC
"SwgDatabaseServer local debug/SwgDatabaseServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
89 print TMRC
"PlanetServer local debug/PlanetServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
90 print TMRC
"SwgGameServer any debug/SwgGameServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
91 print TMRC
"ChatServer local debug/ChatServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
92 print TMRC
"LogServer local debug/LogServer -- \@serverNetwork.cfg \@logServerTargets.cfg\n";
93 print TMRC
"MetricsServer local debug/MetricsServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
94 print TMRC
"CommoditiesServer local debug/CommoditiesServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
98 if(! open(TMRC
, "<taskmanager.debug.rc"))
100 open(TMRC
, ">taskmanager.debug.rc") or die "could not open taskmanager.debug.rc for writing\n";
101 print TMRC
"CentralServer local debug/CentralServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
102 print TMRC
"ConnectionServer local debug/ConnectionServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
103 print TMRC
"SwgDatabaseServer local debug/SwgDatabaseServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
104 print TMRC
"PlanetServer local debug/PlanetServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
105 print TMRC
"SwgGameServer any debug/SwgGameServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
106 print TMRC
"ChatServer local debug/ChatServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
107 print TMRC
"LogServer local debug/LogServer -- \@serverNetwork.cfg \@logServerTargets.cfg\n";
108 print TMRC
"MetricsServer local debug/MetricsServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
109 print TMRC
"CommoditiesServer local debug/CommoditiesServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
113 if(! open(TMRC
, "<taskmanager.release.rc"))
115 open(TMRC
, ">taskmanager.release.rc") or die "could not open taskmanager.release.rc for writing\n";
116 print TMRC
"CentralServer local release/CentralServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
117 print TMRC
"ConnectionServer local release/ConnectionServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
118 print TMRC
"SwgDatabaseServer local release/SwgDatabaseServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
119 print TMRC
"PlanetServer local release/PlanetServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
120 print TMRC
"SwgGameServer any release/SwgGameServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
121 print TMRC
"ChatServer local release/ChatServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
122 print TMRC
"LogServer local release/LogServer -- \@serverNetwork.cfg \@logServerTargets.cfg\n";
123 print TMRC
"MetricsServer local release/MetricsServer -- \@serverNetwork.cfg \@servercommon.cfg\n";
124 print TMRC
"CommoditiesServer local release/CommoditiesServer -- \@serverNetwork.cfg \@servercommon.cfg\n";