Last change
on this file since 1407 was
1223,
checked in by ezyang, 15 years ago
|
Merge scriptsdev changes from trunk (in practice, it should be the other way around).
|
-
Property svn:executable set to
*
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | use strict; |
---|
3 | use FindBin qw($Bin); |
---|
4 | use lib $Bin; |
---|
5 | use onserver; |
---|
6 | use DBI; |
---|
7 | |
---|
8 | setup(); |
---|
9 | |
---|
10 | fetch_uri( |
---|
11 | 'wp-admin/setup-config.php', |
---|
12 | {step => 2}, |
---|
13 | {dbhost => $sqlhost, |
---|
14 | uname => $sqluser, |
---|
15 | dbname => $sqldb, |
---|
16 | pwd => $sqlpass, |
---|
17 | prefix => '', |
---|
18 | submit => 'Submit', |
---|
19 | step => 2}); |
---|
20 | |
---|
21 | my $html = fetch_uri( |
---|
22 | 'wp-admin/install.php', |
---|
23 | {step => 2}, |
---|
24 | {weblog_title => 'My Blog', |
---|
25 | admin_email => $email, |
---|
26 | submit => 'Continue', |
---|
27 | step => 2}); |
---|
28 | while ($html =~ /<code>(.*)<\/code>/g) { |
---|
29 | $admin_username = $admin_password; |
---|
30 | $admin_password = $1; |
---|
31 | } |
---|
32 | |
---|
33 | my $dbh = DBI->connect("dbi:mysql:database=$sqldb;host=$sqlhost", $sqluser, $sqlpass); |
---|
34 | $dbh->do("update wp_options set option_value = ? where option_name = 'siteurl'", |
---|
35 | {}, "/~$USER/$addrend"); |
---|
36 | $dbh->do("update wp_options set option_value = ? where option_name = 'home'", |
---|
37 | {}, "http://$USER.$server/$addrend"); |
---|
38 | $dbh->disconnect; |
---|
39 | |
---|
40 | print_login_info(); |
---|
41 | print "You will also receive this login information at your MIT email address.\n"; |
---|
42 | press_enter(); |
---|
Note: See
TracBrowser
for help on using the repository browser.