File:
[LON-CAPA] /
loncom /
debugging_tools /
get_version.pl
Revision
1.2:
download - view:
text,
annotated -
select for diffs
Tue Oct 17 15:00:07 2006 UTC (17 years, 10 months ago) by
albertel
Branches:
MAIN
CVS tags:
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_99_1,
version_2_2_99_0,
HEAD
i- don't wiat forever for the page to come
1: open(HOST,"<$ARGV[0]");
2: my $i++;
3: my %vers;
4: my %done;
5: while(my $line=<HOST>) {
6: if ($line=~/^\#/) { next; }
7: my $host=(split(':',$line))[3];
8: chomp($host);
9: if (!$host || exists($done{$host})) { next; }
10: $done{$host}=1;
11: print($host." -> ");
12: my $ver=`curl --max-time 15 --connect-timeout 5 -s http://$host/adm/login | grep -- -200 | tr ">" "\n" | tail -1 `;
13: $ver=~s/ //g;
14: $ver=~s/ //g;
15: if ($ver eq "") { print("\n"); }
16: print($ver);
17: $ver=~s/\s//g;
18: push(@{$vers{$ver}},$host);
19: # if ($i++==14) { last; }
20: }
21:
22: foreach my $key (sort(keys(%vers))) {
23: print($key." -> \n");
24: print(" ".join("\n ",@{$vers{$key}})."\n");
25: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>