Diff for /loncom/build/loncaparestoreconfigurations between versions 1.4 and 1.6

version 1.4, 2000/11/02 17:11:05 version 1.6, 2000/11/02 17:30:45
Line 10 Line 10
 use strict;  use strict;
   
 my @special_conf_files=(  my @special_conf_files=(
  "/etc/httpd/conf/access.conf"   "/etc/httpd/conf/access.conf",
    "/etc/smb.conf"
  );   );
   
 my @generic_conf_files=(  my @generic_conf_files=(
Line 18  my @generic_conf_files=( Line 19  my @generic_conf_files=(
  "/home/httpd/lonTabs/spare.tab",   "/home/httpd/lonTabs/spare.tab",
  "/etc/krb.conf",   "/etc/krb.conf",
  "/etc/ntp.conf",   "/etc/ntp.conf",
  "/etc/smb.conf"  
  );   );
   
   my @perlsetvars=("lonHostID","lonRole","lonAdmEMail","lonDefDomain","lonLoadLim","lonExpire");
   my %pvar;
 foreach (@special_conf_files) {  foreach (@special_conf_files) {
     if (/^\/etc\/httpd\/conf\/access.conf$/) {      if (/^\/etc\/httpd\/conf\/access.conf$/) {
  my $template=`/bin/cat /etc/httpd/conf/access.conf`;   my $template=`/bin/cat /etc/httpd/conf/access.conf`;
  my $rpmsave=`/bin/cat /etc/httpd/conf/access.conf.rpmsave`;   my $rpmsave=`/bin/cat /etc/httpd/conf/access.conf.rpmsave`;
  `/bin/mv /etc/httpd/conf/access.conf /etc/httpd/conf/access.conf.template`;   `/bin/mv /etc/httpd/conf/access.conf /etc/httpd/conf/access.conf.template`;
  my @perlsetvars=("lonHostID","lonRole","lonAdmEMail","lonDefDomain","lonLoadLim","lonExpire");  
  foreach my $psv (@perlsetvars) {   foreach my $psv (@perlsetvars) {
     $rpmsave=~/\nPerlSetVar\s+$psv\s+(\S+)/;      $rpmsave=~/\nPerlSetVar\s+$psv\s+(\S+)/;
     my $pval=$1;      my $pval=$1;
     $template=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/;      $template=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/;
       $pvar{$psv}=$pval;
  }   }
  open OUT,">/etc/httpd/conf/access.conf";   open OUT,">/etc/httpd/conf/access.conf";
  print OUT $template;   print OUT $template;
  close OUT;   close OUT;
     }      }
       if (/^\/etc\/smb.conf$/) {
    my $template=`/bin/cat /etc/httpd/conf/access.conf`;
    foreach my $psv (@perlsetvars) {
       $template=~s/\{\{\{\{\[(.*?)\]\}\}\}\}/$pvar{$1}/ge;
    }
    open OUT,">/etc/smb.conf";
    print OUT $template;
    close OUT;
       }
 }  }
   
 foreach (@generic_conf_files) {  foreach (@generic_conf_files) {

Removed from v.1.4  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>