[scripts] mail iso_build.sh failures to root

This commit is contained in:
Fabio Erculiani 2012-09-04 08:36:56 +02:00
parent 54223776db
commit 41dc303441

View File

@ -275,6 +275,17 @@ build_sabayon() {
return 0
}
mail_failure() {
local out=${1}
local log_file=${2}
echo "Hello there,
iso_build.sh execution failed (miserably) with exit status: ${out}.
Log file is at ${log_file}.
Thanks,
Sun" | /bin/mail -s "ISO build script failure" root
}
out="0"
if [ -n "${DO_STDOUT}" ]; then
build_sabayon
@ -291,6 +302,10 @@ else
move_to_pkg_sabayon_org &>> "${log_file}"
out=${?}
fi
if [ "${out}" != "0" ]; then
# mail root
mail_failure "${out}" "${log_file}"
fi
fi
echo "EXIT_STATUS: ${out}"