summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Geissert <geissert@debian.org>2012-12-14 12:25:49 -0600
committerSimon Paillard <spaillard@debian.org>2012-12-17 19:47:16 +0100
commitbc66367f5a6b9e9e3be31a913981f428b44fa98d (patch)
tree6323e2d47b0ca5a645ce2f8da766b21ebd112b81
parent1179550f15209ad663168c5c3d7f66477524a7fc (diff)
Actually send emails on errors and new versions
Signed-off-by: Raphael Geissert <geissert@debian.org>
-rwxr-xr-xbin/ftpsync2
-rw-r--r--etc/common2
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/ftpsync b/bin/ftpsync
index 2cdd98d..ae22406 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -598,7 +598,7 @@ if [ -r "${TO}/project/ftpsync/LATEST.VERSION" ]; then
LATEST=0
fi
if [ ${LATEST} -gt ${VERSION} ]; then
- if [ -z "${MAILTO}" ]; then
+ if [ -n "${MAILTO}" ]; then
difference=0
if [ -f "${LOGDIR}/ftpsync.newversion" ]; then
stamptime=$(< "${LOGDIR}/ftpsync.newversion")
diff --git a/etc/common b/etc/common
index 687c5fe..0501240 100644
--- a/etc/common
+++ b/etc/common
@@ -181,7 +181,7 @@ log () {
# to the address configured in MAILTO (if non-empty)
error () {
log "$@"
- if [ -z "${MAILTO}" ]; then
+ if [ -n "${MAILTO}" ]; then
echo "$@" | mail -e -s "[$PROGRAM@$(hostname -s)] ERROR [$$]" ${MAILTO}
fi
}