#!/usr/bin/perl
use strict;
use lib '/mit/scripts/deploy/bin';
use onserver;
use Cwd;
use File::Path;

setup();

print "\nPlease decide upon a title for your site and enter it below.\n";
print "Desired title: ";
my $title = <STDIN>;
chomp($title);

fetch_uri(
    'installation/install2.php',
    {},
    {DBhostname => $sqlhost,
     DBuserName => $sqluser,
     DBpassword => $sqlpass,
     DBDel => 0,
     DBname => $sqldb,
     DBPrefix => 'jos_',
     DBSample => 1});

fetch_uri(
    'installation/install4.php',
    {},
    {DBhostname => $sqlhost,
     DBuserName => $sqluser,
     DBpassword => $sqlpass,
     DBname => $sqldb,
     DBPrefix => 'jos_',
     sitename => $title,
     siteUrl => $base_uri,
     absolutePath => getcwd(),
     adminEmail => $email,
     adminPassword => $admin_password,
     filePerms => 0,
     dirPerms => 0});

rmtree('installation');
