| 1 | #!/usr/bin/perl | 
|---|
| 2 | use strict; | 
|---|
| 3 | use lib '/mit/scripts/deploy/bin'; | 
|---|
| 4 | use onserver; | 
|---|
| 5 | use File::Path | 
|---|
| 6 |  | 
|---|
| 7 | setup(); | 
|---|
| 8 |  | 
|---|
| 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); | 
|---|
| 15 |  | 
|---|
| 16 | system('patch', 'install/steps/AuthenticateStep.class', | 
|---|
| 17 | '/mit/scripts/deploy/gallery2.patch'); | 
|---|
| 18 |  | 
|---|
| 19 | $ua->cookie_jar({file => '.cookies'}); | 
|---|
| 20 |  | 
|---|
| 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}, {}); | 
|---|
| 26 |  | 
|---|
| 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); | 
|---|
| 32 |  | 
|---|
| 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); | 
|---|
| 45 |  | 
|---|
| 46 | fetch_uri('install/index.php', {step => 6}, | 
|---|
| 47 | {adminName => $admin_username, | 
|---|
| 48 | passwordA => $admin_password, | 
|---|
| 49 | action => 'create', | 
|---|
| 50 | passwordB => $admin_password, | 
|---|
| 51 | email => $email, | 
|---|
| 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}, {}); | 
|---|
| 60 |  | 
|---|
| 61 | unlink '.cookies'; | 
|---|