summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mirmon-snapshots.sh')
-rwxr-xr-xmirmon-snapshots.sh9
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"