Annotation of loncom/build/loncaparestoreconfigurations, revision 1.4
1.1 harris41 1: #!/usr/bin/perl
2:
3: # loncaparestoreconfigurations
4:
5: # This tool helps in updating a system. It takes a list of
6: # .rpmsave files and restores them.
7:
8: # Scott Harrison, 10/25/2000
9:
10: use strict;
11:
12: my @special_conf_files=(
13: "/etc/httpd/conf/access.conf"
14: );
15:
16: my @generic_conf_files=(
17: "/home/httpd/lonTabs/hosts.tab",
18: "/home/httpd/lonTabs/spare.tab",
19: "/etc/krb.conf",
1.4 ! harris41 20: "/etc/ntp.conf",
! 21: "/etc/smb.conf"
1.1 harris41 22: );
23:
24: foreach (@special_conf_files) {
1.3 harris41 25: if (/^\/etc\/httpd\/conf\/access.conf$/) {
1.2 harris41 26: my $template=`/bin/cat /etc/httpd/conf/access.conf`;
27: my $rpmsave=`/bin/cat /etc/httpd/conf/access.conf.rpmsave`;
28: `/bin/mv /etc/httpd/conf/access.conf /etc/httpd/conf/access.conf.template`;
1.1 harris41 29: my @perlsetvars=("lonHostID","lonRole","lonAdmEMail","lonDefDomain","lonLoadLim","lonExpire");
1.2 harris41 30: foreach my $psv (@perlsetvars) {
31: $rpmsave=~/\nPerlSetVar\s+$psv\s+(\S+)/;
32: my $pval=$1;
33: $template=~s/(\nPerlSetVar\s+$psv\s+)\S+/$1$pval/;
34: }
35: open OUT,">/etc/httpd/conf/access.conf";
36: print OUT $template;
37: close OUT;
1.1 harris41 38: }
39: }
40:
41: foreach (@generic_conf_files) {
1.3 harris41 42: if (-e "$_.rpmsave") {
43: `/bin/mv $_ $_.template`;
44: `/bin/mv $_.rpmsave $_`;
45: }
1.1 harris41 46: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>