From f02ede974a14eff2495126fb5bf526149fc20d79 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Sat, 22 Jun 2002 05:38:52 +0000 Subject: [PATCH] Bug fixes. More remaining. --- installer.pl | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/installer.pl b/installer.pl index 6b45c2669b..27f1c3d9aa 100644 --- a/installer.pl +++ b/installer.pl @@ -81,7 +81,8 @@ if (@missing > 0) { print "\n"; my $input; -my $domainname = 'hostname -d'; +my $domainname = `hostname -d`; +chomp $domainname; my $opacdir = '/usr/local/www/opac'; my $kohadir = '/usr/local/www/koha'; print qq| @@ -95,7 +96,7 @@ exist. Usually $opacdir |; -print "Enter directory: "; +print "Enter directory [$opacdir]: "; chomp($input = ); if ($input) { @@ -114,7 +115,7 @@ it doesn't exist. Usually $kohadir |; -print "Enter directory: "; +print "Enter directory [$kohadir]: "; chomp($input = ); if ($input) { @@ -140,7 +141,7 @@ directory. The configuration file, will be created in this directory |; #Get the path to the koha.conf directory -print "Enter the path to your [$etcdir]: "; +print "Enter the path to your configuration directory [$etcdir]: "; chomp($input = ); if ($input) { @@ -156,7 +157,7 @@ This is normally "$dbname". |; -print "Enter database name:"; +print "Enter database name [$dbname]: "; chomp($input = ); if ($input) { @@ -171,7 +172,7 @@ Please provide the hostname for mysql. Unless the database is located on anothe machine this will be "localhost". |; -print "Enter hostname:"; +print "Enter hostname [$hostname]: "; chomp($input = ); if ($input) { @@ -187,7 +188,7 @@ $dbname database, when authenticating from $hostname. If no user is entered it will default to $user. |; -print "Enter username:"; +print "Enter username [$user]:"; chomp($input = ); if ($input) { @@ -253,13 +254,14 @@ $httpduser ||= 'Undetermined'; # Set ownership of the koha.conf file for security # chown((getpwnam($httpduser)) [2,3], "$etcdir/koha.conf") or warn "can't chown koha.conf: $!"; +chmod 0440, "$etcdir/koha.conf"; # #SETUP opac # -my $svr_admin = 'webmaster@$domainname'; -my $opac_svr_name = 'opac.$domainname'; -my $koha_svr_name = 'koha.$domainname'; +my $svr_admin = "webmaster\@$domainname"; +my $opac_svr_name = "opac.$domainname"; +my $koha_svr_name = "koha.$domainname"; print qq| @@ -272,7 +274,7 @@ Please enter the e-mail address for your webserver admin. Usually $svr_admin |; -print "Enter e-mail address:"; +print "Enter e-mail address [$svr_admin]:"; chomp($input = ); if ($input) { @@ -285,7 +287,7 @@ print qq| Please enter the servername for your OPAC interface. Usually $opac_svr_name |; -print "Enter servername address:"; +print "Enter servername address [$opac_svr_name]:"; chomp($input = ); if ($input) { @@ -297,7 +299,7 @@ print qq| Please enter the servername for your Intranet/Librarian interface. Usually $koha_svr_name |; -print "Enter servername address:"; +print "Enter servername address [$koha_svr_name]:"; chomp($input = ); if ($input) { @@ -314,8 +316,14 @@ UPDATING APACHE.CONF ==================== |; -open(SITE,">>$realhttpdconf") or warn "Insufficient priveleges to open $realhttpdconf for writing.\n"; -print SITE < to continue..."; + ; + print "\n"; +} else { + open(SITE,">>$realhttpdconf") or warn "Insufficient priveleges to open $realhttpdconf for writing.\n"; + print SITE < ServerAdmin $svr_admin @@ -339,9 +347,10 @@ print SITE <; chomp $restart; if ($answer eq "Y" || $answer eq "y") { + # Need to support other init structures here? system('/etc/rc.d/init.d/httpd restart'); } else { print qq| -- 2.39.5