#!/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 # Test GCP mirror; added by antarus echo "gentoo rsync://35.190.132.250" >> ./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 [[ -d ../../htdocs/rsync ]] || mkdir ../../htdocs/rsync # Set up a nice link to our mirror page directly: sed \ -e 's#mirrors#mirrors#' \ >../../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