Annotation of doc/loncapafiles/sanitycheck.piml, revision 1.2
1.1 harris41 1: <!-- sanitycheck.piml -->
2: <!-- Scott Harrison -->
3:
1.2 ! harris41 4: <!-- $Id: sanitycheck.piml,v 1.1 2002/03/03 04:29:10 harris41 Exp $ -->
1.1 harris41 5:
6: <!--
7:
8: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9:
10: LON-CAPA is free software; you can redistribute it and/or modify
11: it under the terms of the GNU General Public License as published by
12: the Free Software Foundation; either version 2 of the License, or
13: (at your option) any later version.
14:
15: LON-CAPA is distributed in the hope that it will be useful,
16: but WITHOUT ANY WARRANTY; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: GNU General Public License for more details.
19:
20: You should have received a copy of the GNU General Public License
21: along with LON-CAPA; if not, write to the Free Software
22: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23:
24: /home/httpd/html/adm/gpl.txt
25:
26: http://www.lon-capa.org/
27:
28: -->
29:
30: <piml>
31: <targetroot>/</targetroot>
32: <files>
33: <file>
34: <target dist='default'>/etc/httpd/conf/loncapa.conf</target>
35: <perlscript mode='fg'>
36: open IN, "<<TARGET />";
37: my $hbug=-1;
38: my $dbug=-1;
39: while (<IN>) {
40: if (/PerlSetVar\s+lonHostID\s+(\S+)/) {
41: my $v=$1;
42: $hbug=0;
43: $hbug=1 if $v=~/\W/;
44: $hbug=1 if $v=~/\_/;
45: }
46: if (/PerlSetVar\s+lonDefDomain\s+(\S+)/) {
47: my $v=$1;
48: $dbug=0;
49: $dbug=1 if $v=~/\W/;
50: $dbug=1 if $v=~/\_/;
51: }
52: }
53: if ($hbug) {
54: print "**** ERROR **** <TARGET /> has invalid lonHostID\n";
55: }
56: if ($dbug) {
57: print "**** ERROR **** <TARGET /> has invalid lonDefDomain\n";
58: }
59: </perlscript>
60: </file>
61: <file>
62: <target dist='default'>/home/httpd/lonTabs/hosts.tab</target>
63: open IN, "<<TARGET />";
64: my $rbug=0;
65: my $dbug=0;
66: my $sbug=0;
67: my $fbug=0;
68: while (<IN>) {
69: if (/\S/) {
70: $rbug=1 if /\r/;
71: my @a=split(/\:/,$_);
72: $dbug=1 if $a[0]=~/\W/;
73: $dbug=1 if $a[0]=~/\_/;
74: $dbug=1 if $a[1]=~/\_/;
75: $dbug=1 if $a[1]=~/\W/;
76: $fbug=1 if @a!=5;
77: $sbug=1 if /\s.+$/;
78: }
79: }
80: close IN;
81: if ($rbug) {
82: print "**** ERROR **** <TARGET /> is DOS-formatted\n";
83: }
84: if ($dbug) {
85: print "**** ERROR **** <TARGET /> has invalid host id or domain id\n";
86: }
87: if ($fbug) {
88: print "**** ERROR **** <TARGET /> is lacking 5 columns for every row\n";
89: }
90: if ($sbug) {
91: print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
92: }
93: </file>
94: <file>
95: <target dist='default'>/home/httpd/lonTabs/spare.tab</target>
96: open IN, "<<TARGET />";
97: my $rbug=0;
98: my $dbug=0;
99: my $sbug=0;
100: while (<IN>) {
101: if (/\S/) {
102: $rbug=1 if /\r/;
103: $dbug=1 if $_=~/\W.*\n$/;
104: $dbug=1 if $_=~/\_/;
105: $sbug=1 if /\s.+$/;
106: }
107: }
108: close IN;
109: if ($rbug) {
110: print "**** ERROR **** <TARGET /> is DOS-formatted\n";
111: }
112: if ($dbug) {
113: print "**** ERROR **** <TARGET /> has invalid host id\n";
114: }
115: if ($sbug) {
116: print "**** ERROR **** <TARGET /> has illegal whitespace character\n";
117: }
118: </file>
119: </files>
120: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>