Skip to content

Commit

Permalink
Merge pull request lamw#41 from mbalex/master
Browse files Browse the repository at this point in the history
Added configuration EMAIL_ERRORS_TO
  • Loading branch information
lamw committed Nov 5, 2015
2 parents e432840 + a427f2a commit 0cf5304
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions ghettoVCB.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ EMAIL_SERVER=auroa.primp-industries.com
EMAIL_SERVER_PORT=25
EMAIL_DELAY_INTERVAL=1
[email protected]
EMAIL_ERRORS_TO=
EMAIL_FROM=root@ghettoVCB
WORKDIR_DEBUG=0
VM_SHUTDOWN_ORDER=
Expand Down
13 changes: 12 additions & 1 deletion ghettoVCB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ EMAIL_SERVER_PORT=25
# Email FROM
EMAIL_FROM=root@ghettoVCB

# Email RCPT
# Comma seperated list of receiving email addresses
[email protected]

# Comma seperated list of additional receiving email addresses if status is not "OK"
EMAIL_ERRORS_TO=

# Comma separated list of VM startup/shutdown ordering
VM_SHUTDOWN_ORDER=
VM_STARTUP_ORDER=
Expand Down Expand Up @@ -1317,6 +1320,14 @@ sendMail() {
fi
fi

if [ "${EMAIL_ERRORS_TO}" != "" ] && [ "${LOG_STATUS}" != "OK" ] ; then
if [ "${EMAIL_TO}" == "" ] ; then
EMAIL_TO="${EMAIL_ERRORS_TO}"
else
EMAIL_TO="${EMAIL_TO},${EMAIL_ERRORS_TO}"
fi
fi

echo "${EMAIL_TO}" | grep "," > /dev/null 2>&1
if [[ $? -eq 0 ]] ; then
ORIG_IFS=${IFS}
Expand Down

0 comments on commit 0cf5304

Please sign in to comment.