From 552c1a2937e35fb94db543039dbb74dfb3fffeb1 Mon Sep 17 00:00:00 2001 From: dragon28 Date: Sat, 11 May 2002 05:20:38 +0000 Subject: [PATCH] Now will create koha.conf from scratch. --- installer.pl | 136 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 97 insertions(+), 39 deletions(-) diff --git a/installer.pl b/installer.pl index 733649a21f..46c856e243 100644 --- a/installer.pl +++ b/installer.pl @@ -4,7 +4,7 @@ use diagnostics; use strict; # please develop with the strict pragma system('clear'); -print <; chomp $answer; @@ -30,13 +30,13 @@ chomp $answer; if ($answer eq "Y" || $answer eq "y") { print "Great! continuing setup... \n"; } else { - print <); + print "$conf_path is not a directory.\n" if !-d $conf_path; +} until -d $conf_path; -Checking to see if koha.conf already exists... -EOM -# Check to see if the koha.conf file exists. -# and what its contents may be. -# -# -my($file) = "/etc/koha.conf"; -my($content); -open(FILE, "<", "$file") or die "cannot open $file for reading : $!"; -$content = ; print "\n"; -print "Contents of koha.conf ...\n"; -print $content; -print ; -close (FILE); +print "\n"; +print qq| +Please provide the name of the mysql database for koha. +This is normally "Koha". +|; + +#Get the database name +do { + print "Enter database name:"; + chomp($dbname = ); +}; -# FIXME -# is there a reason we don't just create the conf file here? -# We could ask where the file is to be kept, update our -# scripts to look for it there, and just write out to the -# new file (possibly allowing the installer.pl user to edit the -# file first). -# -#print <); +}; + + +print "\n"; +print "\n"; +print qq| +Please provide the name of the user, who has full administrative +rights to the $dbname database, when authenicating from $hostname. +|; + +#Get the username for the database +do { + print "Enter username:"; + chomp($user = ); +}; + + +print "\n"; +print "\n"; +print qq| +Please provide the password for the user $user. +|; + +#Get the password for the database user +do { + print "Enter password:"; + chomp($pass = ); +}; + + +#Create the configuration file +open(SITES,">$conf_path/koha.conf") or die "Couldn't create file +at $conf_path. Must have write capability.\n"; +#print SITES qq|\database=$dbname\n|; +#print SITES qq|\hostname=$hostname\n|; +#print SITES qq|\user=$user\n|; +#print SITES qq|\password=$pass\n|; +print SITES <