diff options
author | 2020-04-28 10:29:31 -0700 | |
---|---|---|
committer | 2020-04-28 10:29:31 -0700 | |
commit | c830c7267db4b8ed88e440a39e75768a20fd9fa0 (patch) | |
tree | 964be75b85c7a33a3fe378dd7f1f97b01e5a1f55 /mirmon-snapshots.sh | |
parent | refactor mirror list generation (diff) | |
download | gentoo-mirrorstats-c830c7267db4b8ed88e440a39e75768a20fd9fa0.tar.gz gentoo-mirrorstats-c830c7267db4b8ed88e440a39e75768a20fd9fa0.tar.bz2 gentoo-mirrorstats-c830c7267db4b8ed88e440a39e75768a20fd9fa0.zip |
snapshots: also test this
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'mirmon-snapshots.sh')
-rw-r--r-- | mirmon-snapshots.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh new file mode 100644 index 0000000..692a1ef --- /dev/null +++ b/mirmon-snapshots.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_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/snapshots ]] || mkdir ../../htdocs/snapshots +sed \ + -e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors2.xml">mirrors</a></H2>#' \ + >../../htdocs/snapshots/index.html <../../htdocs/snapshots/index-wip.html +# Generate a json file containing the state of each mirror +../json/generate-json.py /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/mirmon.state \ + > ../../htdocs/snapshots/state.json |