diff options
Diffstat (limited to 'mirmon-snapshots.sh')
-rwxr-xr-x | mirmon-snapshots.sh | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh deleted file mode 100755 index 5a5c127..0000000 --- a/mirmon-snapshots.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -MODE=snapshots -SRC=distfiles -SITEDIR=/var/www/mirrorstats.gentoo.org -REPODIR=${SITEDIR}/gentoo-mirrorstats/ -MODEDIR=${REPODIR}/${MODE}_mirrors/ -VARDIR=${SITEDIR}/var/${MODE} -HTDOCS=${SITEDIR}/htdocs/${MODE} -MIRMON=$(readlink -f "${SITEDIR}"/mirmon/mirmon) -CONFFILE=$(readlink -f "${MODEDIR}"/mirmon.conf) -VAR_GMIRRORS=${VARDIR}/g.mirrors -URL=https://www.gentoo.org/downloads/mirrors/ - -# Grab mirrors from the web -mkdir -p "${VARDIR}" -"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VAR_GMIRRORS}".tmp - -EXTRA_MIRRORS=${MODEDIR}/g.mirrors.extra -[[ -e "${EXTRA_MIRRORS}" ]] && cat "${EXTRA_MIRRORS}" >>"${VAR_GMIRRORS}".tmp - -# Atomic rotate into place -mv -f "${VAR_GMIRRORS}"{.tmp,} - -# fatal if the state file is NOT present. -[[ -e ${VARDIR}/mirmon.state ]] || touch "${VARDIR}/mirmon.state" - -# run mirmon -/usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update - -# Set up a nice link to our mirror page directly: -mkdir -p ${HTDOCS} -sed \ - -e "s#mirrors</H2>#<a href="${URL}">mirrors</a></H2>#" \ - >"${HTDOCS}"/index.html.tmp <"${HTDOCS}"/index-wip.html \ - && mv -f "${HTDOCS}"/index.html{.tmp,} - -# Generate a json file containing the state of each mirror -"${REPODIR}"/generate-json.py \ - "${VARDIR}"/mirmon.state \ - >"${HTDOCS}"/state.json.tmp \ - && mv -f "${HTDOCS}"/state.json{.tmp,} |