[127] | 1 | #!/usr/bin/perl |
---|
| 2 | use strict; |
---|
[1222] | 3 | use FindBin qw($Bin); |
---|
| 4 | use lib $Bin; |
---|
[1116] | 5 | use onserver_star; |
---|
[475] | 6 | use File::Path |
---|
[127] | 7 | |
---|
| 8 | setup(); |
---|
| 9 | |
---|
[475] | 10 | my $dir = "/mit/$USER/scripts-gallery2/$sqldb"; |
---|
| 11 | if (-e $dir) { |
---|
| 12 | print STDERR "ERROR: The directory $dir already exists.\nTry selecting a different name."; |
---|
| 13 | exit 1; |
---|
| 14 | } |
---|
| 15 | mkpath($dir); |
---|
[127] | 16 | |
---|
[1104] | 17 | system("patch", "install/steps/AuthenticateStep.class", |
---|
| 18 | "/mit/scripts/deploy$scriptsdev/gallery2.patch"); |
---|
[127] | 19 | |
---|
[475] | 20 | $ua->cookie_jar({file => '.cookies'}); |
---|
[127] | 21 | |
---|
[475] | 22 | fetch_uri('install/index.php'); |
---|
| 23 | fetch_uri('install/index.php', {step => 1}, |
---|
| 24 | {language => 'en_US'}); |
---|
| 25 | fetch_uri('install/index.php', {step => 2}, {}); |
---|
| 26 | fetch_uri('install/index.php', {step => 3}, {}); |
---|
[127] | 27 | |
---|
[475] | 28 | my $post4 = {isMultisite => 0, |
---|
| 29 | dir => $dir, |
---|
| 30 | action => 'save'}; |
---|
| 31 | fetch_uri('install/index.php', {step => 4}, $post4); |
---|
| 32 | fetch_uri('install/index.php', {step => 4}, $post4); |
---|
[127] | 33 | |
---|
[475] | 34 | my $post5 = {type => 'mysql', |
---|
| 35 | hostname => $sqlhost, |
---|
| 36 | action => 'save', |
---|
| 37 | confirmReuseTables => '', |
---|
| 38 | confirmCleanInstall => '', |
---|
| 39 | username => $sqluser, |
---|
| 40 | password => $sqlpass, |
---|
| 41 | database => $sqldb, |
---|
| 42 | tablePrefix => 'g2_', |
---|
| 43 | columnPrefix => 'g_'}; |
---|
| 44 | fetch_uri('install/index.php', {step => 5}, $post5); |
---|
| 45 | fetch_uri('install/index.php', {step => 5}, $post5); |
---|
[127] | 46 | |
---|
[475] | 47 | fetch_uri('install/index.php', {step => 6}, |
---|
| 48 | {adminName => $admin_username, |
---|
| 49 | passwordA => $admin_password, |
---|
| 50 | action => 'create', |
---|
| 51 | passwordB => $admin_password, |
---|
[476] | 52 | email => $email, |
---|
[475] | 53 | fullName => $USER}); |
---|
| 54 | fetch_uri('install/index.php', {step => 7}, {}); |
---|
| 55 | fetch_uri('install/index.php', {step => 8}, {}); |
---|
| 56 | fetch_uri('install/index.php', {step => 9}, |
---|
| 57 | {'module[imagemagick]' => 'on', |
---|
| 58 | activate => 1}); |
---|
| 59 | fetch_uri('install/index.php', {step => 10}, {}); |
---|
| 60 | fetch_uri('install/index.php', {step => 11}, {}); |
---|
[127] | 61 | |
---|
[475] | 62 | unlink '.cookies'; |
---|