From fc204cf8b28969c58ec6440662f0e45bb57b4767 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Mon, 8 Dec 2014 16:11:45 +0100 Subject: [PATCH] make email adresses and path configurable --- config.cfg.sample | 4 ++++ monitor.sh | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.cfg.sample b/config.cfg.sample index 198ed21..c27caeb 100644 --- a/config.cfg.sample +++ b/config.cfg.sample @@ -1,3 +1,7 @@ +TOEMAIL=destination@email.com +FREMAIL=sender@email.com +SENDMAILPATH=/usr/sbin/sendmail + NAME[0]=shortname1 HOST[0]=example.com diff --git a/monitor.sh b/monitor.sh index 3d09fd5..7bb55ba 100755 --- a/monitor.sh +++ b/monitor.sh @@ -10,8 +10,8 @@ function fappend { } function mailsend { - TOEMAIL="mail@mehl.mx"; - FREMAIL="tech@mehl.mx"; + TOEMAIL="$TOEMAIL"; + FREMAIL="$FREMAIL"; SUBJECT="[MON] $1"; MSGBODY1="$2" MSGBODY2="$3" @@ -26,7 +26,7 @@ function mailsend { fappend $TMP ""; fappend $TMP "$MSGBODY2"; fappend $TMP ""; - cat $TMP | /usr/sbin/sendmail -t; + cat $TMP | "$SENDMAILPATH" -t; rm $TMP; }