From 5df4daacebaa6f8901f61bbfc2145c9753ff2de8 Mon Sep 17 00:00:00 2001 From: Marjan Schiller Date: Wed, 12 Jun 2013 16:42:04 +0200 Subject: [PATCH] Added autotest mail script. --- autotest_result_mail.sh | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 autotest_result_mail.sh diff --git a/autotest_result_mail.sh b/autotest_result_mail.sh new file mode 100755 index 0000000..3709c76 --- /dev/null +++ b/autotest_result_mail.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# copyright 2012-2013 Holger Levsen +# GPL2 licenced + +set -e +#set -x +export +echo + +# +# check if mail should be sent +# +if [ ${AUTOTEST_SEND_RESULT_MAIL} == "false" ]; then + echo "No result mail will be send." +fi + +# +# check if we have a LIVEBOOT_BUILD_NUMBER +# +if [ "$LIVEBOOT_BUILD_NUMBER" != "" ] ; then + echo "Ok, got LIVEBOOT_BUILD_NUMBER=$LIVEBOOT_BUILD_NUMBER, which is valid." +else + echo "Fail, no LIVEBOOT_BUILD_NUMBER set." + exit 1 +fi + +if [ "$AUTOTEST_MAIL_CONTENT" != "" ] ; then + echo "Ok, got AUTOTEST_MAIL_CONTENT." +else + echo "Fail, no LIVEBOOT_BUILD_NUMBER set." + exit 1 +fi + +# Replace the place holders +BUILD_NUMBER_TOKEN="" +MAIL_CONTENT=`echo ${$AUTOTEST_MAIL_CONTENT//$BUILD_NUMBER_TOKEN/$LIVEBOOT_BUILD_NUMBER}` + +echo $MAIL_CONTENT +exit 0 + +# +# send announcement mail +# +cat $MAIL_CONTENT | /usr/sbin/sendmail -t +echo +echo "Ok, announcement mail sent." + +# +# finish +# +figlet Ok + -- 2.39.5