mirror of
https://github.com/deajan/obackup.git
synced 2026-02-10 17:10:55 +01:00
Fixed subject in sendmail
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FUNC_BUILD=2015112801
|
||||
FUNC_BUILD=2015113001
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2015 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
@@ -249,7 +249,7 @@ function SendAlert {
|
||||
# </OSYNC SPECIFIC>
|
||||
|
||||
eval "cat \"$LOG_FILE\" $COMPRESSION_PROGRAM > $ALERT_LOG_FILE"
|
||||
MAIL_ALERT_MSG="$MAIL_ALERT_MSG"$'\n\n'$(tail -n 25 "$LOG_FILE")
|
||||
MAIL_ALERT_MSG="$MAIL_ALERT_MSG"$'\n\n'$(tail -n 50 "$LOG_FILE")
|
||||
if [ $ERROR_ALERT -eq 1 ]; then
|
||||
subject="Error alert for $INSTANCE_ID"
|
||||
elif [ $WARN_ALERT -eq 1 ]; then
|
||||
@@ -286,7 +286,7 @@ function SendAlert {
|
||||
fi
|
||||
|
||||
if type sendmail > /dev/null 2>&1 ; then
|
||||
echo -e "$subject\r\n$MAIL_ALERT_MSG" | $(type -p sendmail) $DESTINATION_MAILS
|
||||
echo -e "Subject:$subject\r\n$MAIL_ALERT_MSG" | $(type -p sendmail) $DESTINATION_MAILS
|
||||
if [ $? != 0 ]; then
|
||||
Logger "WARNING: Cannot send alert email via $(type -p sendmail) !!!" "WARN"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user