From 444d89c18d58592a1580d8c6aa8867b50f8eb462 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Wed, 19 Nov 2008 19:59:09 +0100 Subject: runmirrors define mailto use fullpath for ssh keyfile check Signed-off-by: Joerg Jaspert --- bin/runmirrors | 12 ++++++++++-- etc/runmirrors.conf.sample | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/runmirrors b/bin/runmirrors index 6704bae..2cbce58 100755 --- a/bin/runmirrors +++ b/bin/runmirrors @@ -61,9 +61,17 @@ PUSHARCHIVE=${PUSHARCHIVE:-"${CONF}"} PUSHDELAY=${PUSHDELAY:-240} # Which ssh key to use? KEYFILE=${KEYFILE:-".ssh/pushmirror"} +# where to send mails to +if [ "x$(hostname -s)x" != "x${MIRRORNAME%%.debian.org}x" ]; then + # We are not on a debian.org host + MAILTO=${MAILTO:-"root"} +else + # Yay, on a .debian.org host + MAILTO=${MAILTO:-"mirrorlogs@debian.org"} +fi -if ! [ -f "${KEYFILE}" ]; then - error "SSH Key ${KEYFILE} does not exist" >> ${LOG} +if ! [ -f "${BASEDIR}/${KEYFILE}" ]; then + error "SSH Key ${BASEDIR}/${KEYFILE} does not exist" >> ${LOG} exit 5 fi diff --git a/etc/runmirrors.conf.sample b/etc/runmirrors.conf.sample index 4892728..2db6e18 100644 --- a/etc/runmirrors.conf.sample +++ b/etc/runmirrors.conf.sample @@ -28,6 +28,11 @@ ## extra ssh options we might want. *hostwide* #SSH_OPTS="" +## The script can send logs (or error messages) to a mail address. +## If this is unset it will default to the local root user unless it is run +## on a .debian.org machine where it will default to the mirroradm people. +#MAILTO="root" + ## Whats our archive name? We will also tell our leafs about it ## This is usually empty, but if we are called as "runmirrors bpo" ## it will default to bpo. This way one runmirrors script can serve -- cgit v1.2.3