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