[LON-CAPA-cvs] cvs: loncom /debugging_tools modify_config_files.pl

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 11 Aug 2004 17:32:53 -0000


matthew		Wed Aug 11 13:32:53 2004 EDT

  Modified files:              
    /loncom/debugging_tools	modify_config_files.pl 
  Log:
  Added code for /home/www/.my.cnf
  
  
Index: loncom/debugging_tools/modify_config_files.pl
diff -u loncom/debugging_tools/modify_config_files.pl:1.2 loncom/debugging_tools/modify_config_files.pl:1.3
--- loncom/debugging_tools/modify_config_files.pl:1.2	Tue Aug 10 16:26:02 2004
+++ loncom/debugging_tools/modify_config_files.pl	Wed Aug 11 13:32:53 2004
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: modify_config_files.pl,v 1.2 2004/08/10 20:26:02 matthew Exp $
+# $Id: modify_config_files.pl,v 1.3 2004/08/11 17:32:53 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,6 +49,9 @@
 
 use strict;
 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',
              [{section => 'loncapa-updates-i386',
@@ -72,6 +75,20 @@
                key     =>'set-variable=wait_timeout=',
                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;