--- loncom/build/loncaparestoreconfigurations 2000/10/26 00:28:43 1.3 +++ loncom/build/loncaparestoreconfigurations 2000/11/02 17:26:21 1.5 @@ -10,31 +10,42 @@ use strict; my @special_conf_files=( - "/etc/httpd/conf/access.conf" + "/etc/httpd/conf/access.conf", + "/etc/smb.conf" ); my @generic_conf_files=( "/home/httpd/lonTabs/hosts.tab", "/home/httpd/lonTabs/spare.tab", "/etc/krb.conf", - "/etc/ntp.conf" + "/etc/ntp.conf", ); +my @perlsetvars=("lonHostID","lonRole","lonAdmEMail","lonDefDomain","lonLoadLim","lonExpire"); foreach (@special_conf_files) { if (/^\/etc\/httpd\/conf\/access.conf$/) { my $template=`/bin/cat /etc/httpd/conf/access.conf`; my $rpmsave=`/bin/cat /etc/httpd/conf/access.conf.rpmsave`; `/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) { $rpmsave=~/\nPerlSetVar\s+$psv\s+(\S+)/; my $pval=$1; $template=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/; + $pvar{$psv}=$pval; } open OUT,">/etc/httpd/conf/access.conf"; print OUT $template; 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) {