mail_wrap_script.sh: add error code to mail output
This commit is contained in:
parent
7c0b8bae26
commit
1d6c448599
@ -18,7 +18,7 @@ rm /tmp/$FILE_ID.log
|
|||||||
if [ $ERR -ne 0 ]; then
|
if [ $ERR -ne 0 ]; then
|
||||||
MAILTO=$(cat "$HOME/.admin_mail")
|
MAILTO=$(cat "$HOME/.admin_mail")
|
||||||
echo "Sending error mail"
|
echo "Sending error mail"
|
||||||
echo -e "An error occured during the execution of $SCRIPT.\n\n$OUTPUT" | mailx -s "$(hostname) $SCRIPT failure" "$MAILTO"
|
echo -e "An error occured during the execution of $SCRIPT ($ERR).\n\n$OUTPUT" | mailx -s "$(hostname) $SCRIPT failure" "$MAILTO"
|
||||||
echo "Sent"
|
echo "Sent"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user