ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/apache2-frontend/check
Revision: 1.4
Committed: Thu Jun 18 16:35:01 2015 UTC (8 years, 11 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/opt/bin/perl
2    
3 root 1.2 use FindBin;
4 root 1.1 use LWP::Simple;
5    
6 root 1.2 open my $fh, "<", "$FindBin::Bin/checklist"
7 root 1.1 or die "check.txt: $!";
8    
9     while (<$fh>) {
10     chomp;
11 root 1.3 next if /^#/;
12    
13 root 1.1 my ($url, $content) = split /\t+/;
14    
15 root 1.4 $url =~ s,^([^/]+)/,$1:34567/, if $ARGV[0] eq "-t";
16 root 1.1
17     $url = "http://$url";
18    
19     my $res = get $url;
20    
21     if ($res =~ $content) {
22     print "$url OK\n";
23     } else {
24     print "$url NOT OK\n";
25     print "$res\n$content\n";
26     exit 1;
27     }
28     }
29