3 use lib '/usr/share/perl5/';
7 $m = Mirmon -> new ( '/etc/mirmon.conf' );
9 $conf = $m->conf ; # a Mirmon::Conf object
10 $state = $m->state ; # the mirmon state
15 foreach my $url ( keys %{$state} ) {
16 next unless $url =~ /^http/;
17 $mirror = $state -> { $url } ; # a Mirmon::Mirror object
18 my ($time, $history) = split('-', $mirror->{state_history});
19 my $last_state = substr($history,-1,1);
20 my $region = $mirror->region;
21 $regions_hash->{$region} = 1;
22 next if $last_state eq 'f';
23 $mirrors->{ $region } ||= [];
24 $url =~ s/^http:\/\///;
25 push @{$mirrors->{ $region }}, $url;
28 my @regions = keys(%$regions_hash);
30 foreach my $region (@regions) {
31 if (scalar(@{$mirrors->{$region}}) == 0) {
32 printf ("%s %s\n", lc($region), join('|', @{$mirrors->{'DE'}}));
34 printf ("%s %s\n", lc($region), join('|', @{$mirrors->{$region}}));