mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user