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
+16 -2
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"