--- /dev/null
+#!/usr/bin/perl
+
+use lib '/usr/share/perl5/';
+
+use Mirmon::Mirmon ;
+
+$m = Mirmon -> new ( '/etc/mirmon.conf' );
+
+$conf = $m->conf ; # a Mirmon::Conf object
+$state = $m->state ; # the mirmon state
+
+use Data::Dumper;
+my $mirrors;
+foreach my $url ( keys %{$state} ) {
+ next unless $url =~ /^http/;
+ $mirror = $state -> { $url } ; # a Mirmon::Mirror object
+ my ($time, $history) = split('-', $mirror->{state_history});
+ my $last_state = substr($history,-1,1);
+ next if $last_state eq 'f';
+ my $region = $mirror->region;
+ $mirrors->{ $region } ||= [];
+ $url =~ s/^http:\/\///;
+ push @{$mirrors->{ $region }}, $url;
+}
+
+foreach my $region (keys %{$mirrors}) {
+ printf ("%s %s\n", lc($region), join('|', @{$mirrors->{$region}}));
+}
--- /dev/null
+#!/bin/sh
+
+#update mirrorlist from git
+cd /usr/local/src/grml-mirrors
+git reset --hard >/dev/null
+git pull >/dev/null
+perl masterlist2mirmon Mirrors.masterlist > /etc/mirmon/mirror.list
+#first run mirmon
+LC_ALL=C /usr/bin/mirmon -q -get update 2>/dev/null
+#then generatore the mirror map
+/usr/local/bin/generate_mirror_map > /etc/apache2/grml.map
+#give a hint to apache2
+/usr/sbin/apache2ctl graceful
--- /dev/null
+# for detail, see its manual page.
+
+countries /usr/share/mirmon/countries.list
+timeout 10
+
+
+# example for Debian mirror
+project_name GRML
+project_url http://www.grml.org/
+project_logo http://grml.org/img/logo.png
+mirror_list /etc/mirmon/mirror.list
+probe /usr/bin/probe -q -t %TIMEOUT% %URL%timestamp.txt
+min_sync 6h
+max_sync 12h
+min_poll 30m
+max_poll 1h
+# /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%timestamp.txt
+
+state /var/lib/mirmon/state
+web_page /var/www/mirror.grml.org/index.html
+
+# about icons' location, see sample apache configuration
+icons icons