summaryrefslogtreecommitdiff
blob: 1e432e238cb5805578924f72144d25eed9244f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

INFRA="
albatross
boobie
dipper
quetzal
starling
swan
"

cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/rsync_mirrors
# Grab mirrors from the web
[[ -d ./var ]] || mkdir ./var
../get-mirrors-from-rsync-xml.rb > ./var/g.mirrors
# infra mirrors, "manually added" to list to check
for i in ${INFRA}; do
	echo "gentoo rsync://$i.gentoo.org/" >> ./var/g.mirrors
done
# fatal if the state file is NOT present.
[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
# run mirmon
/usr/bin/perl ../../mirmon/mirmon -c ./mirmon.conf -q -get update
[[ -d ../../htdocs/rsync ]] || mkdir ../../htdocs/rsync
# Set up a nice link to our mirror page directly:
sed \
    -e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors-rsync.xml">mirrors</a></H2>#' \
    >../../htdocs/rsync/index.html <../../htdocs/rsync/index-wip.html
# Generate a json file containing the state of each mirror
../json/generate-json.py /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/rsync_mirrors/var/mirmon.state \
  > ../../htdocs/rsync/state.json