Added command-line option -r, which allows to specify an alternative recipient e-mail address. Convenient for having output of testruns sent to an alternative e-mail address.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1942 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2010-08-07 11:06:22 +00:00
parent a31eb3885b
commit 3f2e2bf09c
2 changed files with 34 additions and 3 deletions

View File

@@ -41,15 +41,31 @@ runcmd () {
return $res
}
usage () {
echo "usage: $0 [-r <recipient>] <tag>"
}
#----------------------------------------------------------------------------
# Startup
#----------------------------------------------------------------------------
scst_svn_repo="https://scst.svn.sourceforge.net/svnroot/scst/trunk"
sendmail_opts=""
set -- $(/usr/bin/getopt "r:" "$@")
while [ "$1" != "${1#-}" ]
do
case "$1" in
'-h') usage; exit 1;;
'-r') sendmail_opts="$1 $2"; shift; shift;;
'--') shift;;
*) usage; exit 1;;
esac
done
# Must have exactly one argument
if [ "$#" -ne 1 ] ; then
echo "usage: $0 <tag>"
usage
exit 1
fi
@@ -183,5 +199,6 @@ fi
# Use the conf/<tag>.sendmail script to email the results.
conf/$ABT_MACHINE.sendmail \
${sendmail_opts} \
"$changed_str$ABT_START nightly build ($ABT_MACHINE, $ABT_DETAILS)" \
final > sendmail.log 2>&1

View File

@@ -1,10 +1,24 @@
#!/bin/sh
# usage: $0 subject file-to-mail [file-to-attach]
# Don't forget to set the variables 'from' and 'realname' in ~/.muttrc !!
usage() {
echo "Usage: $0 [-r <recipient>] <subject> <file-to-mail> [<file-to-attach>]"
}
recipients="scst-devel@lists.sourceforge.net"
#recipients="bart.vanassche@gmail.com"
set -- $(/usr/bin/getopt "r:" "$@")
while [ "$1" != "${1#-}" ]
do
case "$1" in
'-r') recipients="$2"; shift; shift;;
'-h') usage; exit 1;;
'--') shift;;
*) usage; exit 1;;
esac
done
if [ $# -ge 3 ]; then
gzip -9 <"$3" >"$3.gz"
mutt -s "$1" -a "$3.gz" ${recipients} < "$2"