--- loncom/build/loncaparestoreconfigurations 2001/06/01 16:00:44 1.10 +++ loncom/build/loncaparestoreconfigurations 2001/11/27 23:23:47 1.11 @@ -25,7 +25,7 @@ my $suffix=".rpmsave"; my $suffixpragma=""; if ($ARGV[0] eq 'suffix') { - $suffix=$ARGV[1] if $suffix=~/^[\.\w]+$/; + $suffix=$ARGV[1] if $ARGV[1]=~/^[\.\w]+$/; } elsif ($ARGV[0] eq 'lasttimestamp') { $suffixpragma="lasttimestamp"; @@ -56,32 +56,35 @@ foreach (@special_conf_files) { $suffix=getsuffix('/etc/httpd/conf/access.conf'); } my $template=`/bin/cat /etc/httpd/conf/access.conf`; - my $rpmsave=`/bin/cat /etc/httpd/conf/access.conf$suffix`; - `/bin/mv /etc/httpd/conf/access.conf /etc/httpd/conf/access.conf.template`; + my $lpmlnew=`/bin/cat /etc/httpd/conf/access.conf$suffix`; +# `/bin/mv /etc/httpd/conf/access.conf /etc/httpd/conf/access.conf.template`; foreach my $psv (@perlsetvars) { - $rpmsave=~/\nPerlSetVar\s+$psv\s+(\S+)/; + $template=~/\nPerlSetVar\s+$psv\s+(\S+)/; my $pval=$1; - $template=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/; + $lpmlnew=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/; $pvar{$psv}=$pval; } - open OUT,">/etc/httpd/conf/access.conf"; - print OUT $template; + open OUT,">/etc/httpd/conf/access.conf$suffix"; + print OUT $lpmlnew; close OUT; } if (/^\/etc\/smb.conf$/) { if ($suffixpragma eq 'lasttimestamp') { $suffix=getsuffix('/etc/smb.conf'); } - my $template=`/bin/cat /etc/smb.conf`; + my $template=`/bin/cat /etc/smb.conf$suffix`; foreach my $psv (@perlsetvars) { $template=~s/\{\{\{\{\[(.*?)\]\}\}\}\}/$pvar{$1}/ge; } - open OUT,">/etc/smb.conf"; + open OUT,">/etc/smb.conf$suffix"; print OUT $template; close OUT; } } +exit; # Just because this is only about restoring configuration to + # new files + foreach (@generic_conf_files) { my $file=$_; if ($suffixpragma eq 'lasttimestamp') {