source: locker/deploy/bin/wordpress @ 725

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