version 1.1, 2004/08/09 21:05:40
|
version 1.3, 2004/08/11 17:32:53
|
Line 49 copies of each file are made in /etc.
|
Line 49 copies of each file are made in /etc.
|
|
|
use strict; |
use strict; |
use File::Copy; |
use File::Copy; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA::Configuration; |
|
my $loncapa_config=LONCAPA::Configuration::read_conf('loncapa.conf'); |
|
|
&update_file('/etc/yum.conf', |
&update_file('/etc/yum.conf', |
[{section => 'loncapa-updates-i386', |
[{section => 'loncapa-updates-i386', |
Line 72 use File::Copy;
|
Line 75 use File::Copy;
|
key =>'set-variable=wait_timeout=', |
key =>'set-variable=wait_timeout=', |
value =>'31536000', }]); |
value =>'31536000', }]); |
|
|
|
|
|
my $local_my_cnf = '/home/www/.my.cnf'; |
|
if (! -e $local_my_cnf) { |
|
# # Create a file so we can do something with it... |
|
system("touch $local_my_cnf"); |
|
} |
|
&update_file($local_my_cnf, |
|
[{section =>'client', |
|
key =>'user=', |
|
value =>'www',}, |
|
{section =>'client', |
|
key =>'password=', |
|
value =>$loncapa_config->{'lonSqlAccess'}},]); |
|
|
exit; |
exit; |
|
|
|
|
Line 259 sub modify_config_file {
|
Line 276 sub modify_config_file {
|
unshift(@$target,$newline); |
unshift(@$target,$newline); |
} else { |
} else { |
# No need to put things after a blank line. |
# No need to put things after a blank line. |
if ($target->[-1] =~ /^\s*$/) { |
if (defined($target->[-1]) && $target->[-1] =~ /^\s*$/) { |
$target->[-1] = $newline; |
$target->[-1] = $newline; |
} else { |
} else { |
push(@$target,$newline); |
push(@$target,$newline); |