diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2020-04-28 21:46:23 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2020-04-28 21:46:23 -0700 |
commit | 448bf5d0dededcbcc24c82318eb9e5f05ba10eb8 (patch) | |
tree | d418b1de481dc951eb5e7346ac03c5d717a41f4d /mirmon-snapshots.sh | |
parent | Update json path (diff) | |
download | gentoo-mirrorstats-448bf5d0dededcbcc24c82318eb9e5f05ba10eb8.tar.gz gentoo-mirrorstats-448bf5d0dededcbcc24c82318eb9e5f05ba10eb8.tar.bz2 gentoo-mirrorstats-448bf5d0dededcbcc24c82318eb9e5f05ba10eb8.zip |
snapshots: prepare for common mirmon runner code via specific mirrors
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'mirmon-snapshots.sh')
-rwxr-xr-x | mirmon-snapshots.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh index b1198de..0f10688 100755 --- a/mirmon-snapshots.sh +++ b/mirmon-snapshots.sh @@ -11,10 +11,17 @@ 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 # Grab mirrors from the web mkdir -p "${VARDIR}" -"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VARDIR}"/g.mirrors.tmp && mv -f "${VARDIR}"/g.mirrors{.tmp,} +"${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" |