Skip to content

Commit 99ae1c1

Browse files
committedJan 4, 2012
Rip out mysql setup code from the wreconsole.
1 parent ba8b0fc commit 99ae1c1

File tree

1 file changed

+3
-57
lines changed

1 file changed

+3
-57
lines changed
 

‎wre/sbin/wreconsole.pl

+3-57
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
LocalAddr => undef,
5454
LocalPort => 60834,
5555
);
56-
if ($osname eq "darwin" || $osname eq "freebsd") {
56+
if ($osname eq "darwin") {
5757
$serverProperties{ReusePort} = 1;
5858
}
5959

@@ -1068,14 +1068,10 @@ sub www_setup {
10681068

10691069
# apache stuff
10701070
if ($cgi->param("step") eq "apache") {
1071-
if ($host->getOsName ne "windows" && !(getpwnam $collected->{wreUser})) {
1072-
$out .= qq|<p class="status">There is no user $collected->{wreUser} on this system, please create it or go
1073-
back and change the user you'd like to run the WRE under.</p>|;
1074-
}
10751071
my $nginx = $config->get("nginx");
10761072
$out .= '<h1>Apache</h1>
10771073
<form action="/setup" method="post">
1078-
<input type="hidden" name="step" value="mysql">
1074+
<input type="hidden" name="step" value="webgui">
10791075
<input type="hidden" name="collected" value="'.$collectedJson.'" />
10801076
<p>
10811077
nginx Port <br />
@@ -1091,42 +1087,6 @@ sub www_setup {
10911087
';
10921088
}
10931089

1094-
# mysql stuff
1095-
elsif ($cgi->param("step") eq "mysql") {
1096-
if (-f "/etc/my.cnf") {
1097-
$out .= q|<p class="status">There is a file at /etc/my.cnf that you must move or it will interfere with the WRE.</p>|;
1098-
}
1099-
if (-f "/my.ini") {
1100-
$out .= q|<p class="status">There is a file at /my.ini that you must move or it will interfere with the WRE.</p>|;
1101-
}
1102-
my $mysql = $config->get("mysql");
1103-
$out .= '<h1>MySQL</h1>
1104-
<form action="/setup" method="post">
1105-
<input type="hidden" name="step" value="webgui">
1106-
<input type="hidden" name="collected" value="'.$collectedJson.'" />
1107-
<p>
1108-
Host <br />
1109-
<input type="text" name="mysqlHost" value="'.($collected->{mysqlHost} || $mysql->{hostname}).'" />
1110-
</p>
1111-
<p>
1112-
Port <br />
1113-
<input type="text" name="mysqlPort" value="'.($collected->{mysqlPort} || $mysql->{port}).'" />
1114-
</p>
1115-
<p>
1116-
Admin User <br />
1117-
<input type="text" name="mysqlAdminUser" value="'.($collected->{mysqlAdminUser} || $mysql->{adminUser}).'" />
1118-
</p>
1119-
<p>
1120-
Admin Password <br />
1121-
<input type="text" name="mysqlAdminPassword" value="'.($collected->{mysqlAdminPassword} || "123qwe").'" />
1122-
</p>
1123-
<input type="button" class="deleteButton" value="&laquo; Previous"
1124-
onclick="this.form.step.value=\'apache\';this.form.submit();" />
1125-
<input type="submit" class="saveButton" value="Next &raquo;" />
1126-
</form>
1127-
';
1128-
}
1129-
11301090
# webgui stuff
11311091
elsif ($cgi->param("step") eq "webgui") {
11321092
$out .= '<h1>WebGUI</h1>
@@ -1229,21 +1189,10 @@ sub www_setup {
12291189
print $socket "<p>Creating default databases</p>";
12301190
$file->makePath($config->getRoot("/var/mysqldata"));
12311191
chdir($config->getRoot("/prereqs"));
1232-
if ($host->getOsName eq "windows") {
1233-
$file->copy($config->getRoot("/var/setupfiles/my.cnf"),
1234-
$config->getRoot("/etc/my.ini"),
1235-
{ force => 1, templateVars=>{osName=>$host->getOsName} });
1236-
$file->copy($config->getRoot("/prereqs/data/"),
1237-
$config->getRoot("/var/mysqldata/"),
1238-
{ force => 1, recursive => 1 });
1239-
system($config->getRoot("/sbin/services/windows/mysql-install.bat"));
1240-
}
1241-
else {
12421192
$file->copy($config->getRoot("/var/setupfiles/my.cnf"),
12431193
$config->getRoot("/etc/my.cnf"),
12441194
{ force => 1, processTemplate=>1 });
12451195
system(file("bin/mysql_install_db")->stringify." --user=".$collected->{wreUser}." --port=" . $collected->{mysqlPort});
1246-
}
12471196
print $socket "<p>Starting MySQL</p>";
12481197
$mysql->start;
12491198
print $socket "<p>Connecting</p>";
@@ -1338,12 +1287,9 @@ sub www_setup {
13381287

13391288
print $socket "<p>Extracting WebGUI. Please be patient, this can take a while.</p>$crlf";
13401289
eval { $update->extractArchive($download) };
1341-
if ($@ && $host->getOsName ne "windows") {
1290+
if ($@) {
13421291
print $socket "<p>Had some errors extracting WebGUI. $@</p>$crlf";
13431292
}
1344-
elsif ($@ && $host->getOsName eq "windows") {
1345-
print STDERR "\nNOTICE:\nYou can safely ignore all the tar extraction errors above. They\nare do to the differences between *nix and Windows file systems.\n";
1346-
}
13471293
}
13481294
eval {
13491295
open my $in, '<', $config->getWebguiRoot("/etc/log.conf.original")

0 commit comments

Comments
 (0)
Please sign in to comment.