summaryrefslogtreecommitdiff
blob: fedefdc380571806c08c0908793cb8bd98b2381c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/distfiles_mirrors
# Grab mirrors from the web
[[ -d ./var ]] || mkdir ./var
../get-mirrors-from-distfiles-xml.rb > ./var/g.mirrors
# 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
# Set up a nice link to our mirror page directly:
[[ -d ../../htdocs/distfiles ]] || mkdir ../../htdocs/distfiles
sed \
    -e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors2.xml">mirrors</a></H2>#' \
    >../../htdocs/distfiles/index.html <../../htdocs/distfiles/index-wip.html
# Generate a json file containing the state of each mirror
../json/generate-json.py /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/distfiles_mirrors/var/mirmon.state \
  > ../../htdocs/distfiles/state.json