| 
                Last change
                  on this file since 2580 was
                  1222,
                  checked in by ezyang, 16 years ago
           | 
        
        
          | 
            Fix incorrect including of production onserver.pm when scriptsdev=dev is used.
           | 
        
        
          
            
              - 
                  Property svn:executable set to
                  
*
               
             
           | 
        
        | 
            File size:
            1.0 KB
           | 
      
      
        
  | Rev | Line |   | 
|---|
| [127] | 1 | #!/usr/bin/perl | 
|---|
 | 2 | use strict; | 
|---|
| [1222] | 3 | use FindBin qw($Bin); | 
|---|
 | 4 | use lib $Bin; | 
|---|
| [127] | 5 | use onserver; | 
|---|
| [725] | 6 | use DBI; | 
|---|
| [127] | 7 |  | 
|---|
 | 8 | setup(); | 
|---|
 | 9 |  | 
|---|
| [468] | 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}); | 
|---|
| [127] | 20 |  | 
|---|
| [468] | 21 | my $html = fetch_uri( | 
|---|
 | 22 |     'wp-admin/install.php', | 
|---|
 | 23 |     {step => 2}, | 
|---|
 | 24 |     {weblog_title => 'My Blog', | 
|---|
| [476] | 25 |      admin_email => $email, | 
|---|
| [468] | 26 |      submit => 'Continue', | 
|---|
 | 27 |      step => 2}); | 
|---|
| [743] | 28 | while ($html =~ /<code>(.*)<\/code>/g) { | 
|---|
| [468] | 29 |     $admin_username = $admin_password; | 
|---|
 | 30 |     $admin_password = $1; | 
|---|
 | 31 | } | 
|---|
| [127] | 32 |  | 
|---|
| [725] | 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 |  | 
|---|
| [127] | 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.