From 3153d38adc77b535d329b9251e0522536c7331ea Mon Sep 17 00:00:00 2001 From: tonnesen Date: Mon, 8 Jul 2002 18:34:35 +0000 Subject: [PATCH] Bug fixes from rel-1-2 --- installer.pl | 71 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/installer.pl b/installer.pl index 230ac3237f..496bac112b 100644 --- a/installer.pl +++ b/installer.pl @@ -3,6 +3,10 @@ use diagnostics; use strict; # please develop with the strict pragma +if ($<) { + print "\n\nYou must run koha.upgrade as root.\n\n"; + exit; +} unless ($< == 0) { print "You must be root to run this script.\n"; exit 1; @@ -267,21 +271,6 @@ if ($input) { print "\n"; -#Create the configuration file -open(SITES,">$etcdir/koha.conf") or warn "Couldn't create file -at $etcdir. Must have write capability.\n"; -print SITES <); + + if ($input) { + $httpduser = $input; + } else { + $httpduser='Undetermined'; + } +} + + +#Create the configuration file +open(SITES,">$etcdir/koha.conf") or warn "Couldn't create file +at $etcdir. Must have write capability.\n"; +print SITES <); - -if ($input) { - $mysqlpass = $input; +my $needpassword=1; +while ($needpassword) { + print "Enter mysql\'s root users password: "; + chomp($input = ); + $mysqlpass = $input; + my $result=system("$mysqldir/bin/mysqladmin -u$mysqluser -p$mysqlpass proc > /dev/null 2>&1"); + if ($result) { + print "\n\nInvalid password for the MySql root user.\n\n"; + } else { + $needpassword=0; + } } -- 2.39.2