X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcommon;fp=config%2Fdebian%2Fcommon;h=c9363bc8d1f294669533cbabf312e53a17fb3059;hb=9914190d8f003e8bbf8a0504a954c25600516299;hp=5a7ec0bf8cabe6815d3feafaacac328dde244e8a;hpb=15449de742543b884babbd11a0e08ad91fa50abf;p=dak.git diff --git a/config/debian/common b/config/debian/common index 5a7ec0bf..c9363bc8 100644 --- a/config/debian/common +++ b/config/debian/common @@ -3,17 +3,17 @@ # # Set $PROGRAM to a string to have it added to the output. function log () { - local prefix=${PROGRAM:-} - echo "$(date +"%b %d %H:%M:%S") $(hostname -s) ${prefix}[$$]: $@" + local prefix=${PROGRAM:-} + echo "$(date +"%b %d %H:%M:%S") $(hostname -s) ${prefix}[$$]: $@" } # log the message using log() but then also send a mail # to the address configured in MAILTO (if non-empty) function log_error () { - log "$@" - if [ -z "${MAILTO}" ]; then - echo "$@" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@$(hostname -s)] ERROR [$$]" -a "From: Debian FTP Masters " ${MAILTO} - fi + log "$@" + if [ -z "${MAILTO}" ]; then + echo "$@" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@$(hostname -s)] ERROR [$$]" -a "From: Debian FTP Masters " ${MAILTO} + fi } # debug log, only output when DEBUG=1