--- loncom/build/loncaparestoreconfigurations 2001/11/27 23:23:47 1.11 +++ loncom/build/loncaparestoreconfigurations 2002/03/03 00:21:23 1.12 @@ -36,7 +36,8 @@ use strict; my @special_conf_files=( "/etc/httpd/conf/access.conf", - "/etc/smb.conf" + "/etc/smb.conf", + "/etc/samba/smb.conf" ); my @generic_conf_files=( @@ -59,16 +60,17 @@ foreach (@special_conf_files) { 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) { - $template=~/\nPerlSetVar\s+$psv\s+(\S+)/; - my $pval=$1; - $lpmlnew=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/; - $pvar{$psv}=$pval; + if ($template=~/\nPerlSetVar\s+$psv\s+(\S+)/) { + my $pval=$1; + $lpmlnew=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/; + $pvar{$psv}=$pval; + } } open OUT,">/etc/httpd/conf/access.conf$suffix"; print OUT $lpmlnew; close OUT; } - if (/^\/etc\/smb.conf$/) { + if (/^\/etc\/smb.conf$/ and -e "/etc/smb.conf$suffix") { if ($suffixpragma eq 'lasttimestamp') { $suffix=getsuffix('/etc/smb.conf'); } @@ -80,6 +82,18 @@ foreach (@special_conf_files) { print OUT $template; close OUT; } + if (/^\/etc\/samba\/smb.conf$/ and -e "/etc/samba/smb.conf$suffix") { + if ($suffixpragma eq 'lasttimestamp') { + $suffix=getsuffix('/etc/samba/smb.conf'); + } + my $template=`/bin/cat /etc/samba/smb.conf$suffix`; + foreach my $psv (@perlsetvars) { + $template=~s/\{\{\{\{\[(.*?)\]\}\}\}\}/$pvar{$1}/ge; + } + open OUT,">/etc/samba/smb.conf$suffix"; + print OUT $template; + close OUT; + } } exit; # Just because this is only about restoring configuration to