This commit is contained in:
6543 2018-05-17 01:04:21 +02:00
parent fcbfdff33a
commit 55a17ad2ce
1 changed files with 19 additions and 19 deletions

View File

@ -4,28 +4,28 @@


#on_exit [error_level] #on_exit [error_level]
function on_exit() { function on_exit() {
#send log and errorlevel[success/errorr xy] #send log and errorlevel[success/errorr xy]


if [ "$1" != "0" ]; then if [ "$1" != "0" ]; then
log_mail_subject="$log_mail_subject [ERROR]" log_mail_subject="$log_mail_subject [ERROR]"
else else
log_mail_subject="$log_mail_subject [Success]" log_mail_subject="$log_mail_subject [Success]"
fi fi


#Mail Body: #Mail Body:
for mail_aim in `echo "$log_mail_aim" | tr "," " "`; do for mail_aim in `echo "$log_mail_aim" | tr "," " "`; do
{ {
echo "$log_mail_subject" echo "$log_mail_subject"
echo $'####################################################################################\n\n' echo $'####################################################################################\n\n'
cat "$log_file" cat "$log_file"
} | sendemail -s "$log_mail_smtp" -f "$log_mail_source" -t "$mail_aim" -u "$log_mail_subject" -o tls=no } | sendemail -s "$log_mail_smtp" -f "$log_mail_source" -t "$mail_aim" -u "$log_mail_subject" -o tls=no
done done


[ "$1" != "0" ] && { [ "$1" != "0" ] && {
chroot_umount$distro "$chroot_path" 2> /dev/null chroot_umount$distro "$chroot_path" 2> /dev/null
workspace_erase "$iso_extr_dir/" "$chroot_path/" 2> /dev/null workspace_erase "$iso_extr_dir/" "$chroot_path/" 2> /dev/null
} }
exit $1 exit $1
} }


#this func is standalone executable #this func is standalone executable