From a28a35bb6cb722f6737c36f82417bbd12a59b724 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 7 Sep 2015 11:04:56 +0200 Subject: [PATCH] include weekly summary in the report email. https://bugs.eressea.de/view.php?id=2135#c6115 --- .gitignore | 1 + process/send-bz2-report | 21 ++++++++------------- process/send-zip-report | 5 ++++- s/install | 2 +- s/runtests | 1 + 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 1c6507e5d..8ae1608bb 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ Thumbs.db *.cfg *.cmd tmp/ +tests/config.lua diff --git a/process/send-bz2-report b/process/send-bz2-report index 733b5c6be..e9962d539 100755 --- a/process/send-bz2-report +++ b/process/send-bz2-report @@ -1,6 +1,10 @@ #!/bin/bash if [ -z $ERESSEA ]; then - echo "You have to define the \$ERESSEA environment variable to run $0" + ERESSEA=`echo $PWD |sed -e 's/\/game.*//'` + echo "Assuming that ERESSEA=$ERESSEA" +fi +if [ ! -f reports.txt ]; then + echo "need to run $0 from the report direcory" exit -2 fi source $HOME/bin/functions.sh @@ -19,17 +23,8 @@ then shift fi -EMAIL=$1 -SUBJECT=$2 +addr=$1 +subj=$2 shift 2 -ATTACHMENTS="" -while [ $# -gt 0 ] -do - if [ -e "$1" ]; then - ATTACHMENTS="-a $1 $ATTACHMENTS" - fi - shift -done - -cat $ERESSEA/etc/$TEMPLATE | mutt -F $ERESSEA/etc/muttrc -s "$SUBJECT" $ATTACHMENTS -- $EMAIL +cat $ERESSEA/etc/$TEMPLATE | mutt -F $ERESSEA/etc/muttrc -s "$subj" -a $* -- $addr diff --git a/process/send-zip-report b/process/send-zip-report index fb068c33f..7926de8f7 100755 --- a/process/send-zip-report +++ b/process/send-zip-report @@ -39,7 +39,10 @@ while [ -e /tmp/.stopped ] ; do echo "waiting 2 minutes for lockfile in /tmp/.stopped to clear" sleep 120 done -mutt -F $ERESSEA/etc/muttrc -s "$2" -a "$3" -- $1 < $TEMPLATE +addr=$1 +subject=$2 +shift 2 +mutt -F $ERESSEA/etc/muttrc -s "$subject" -a $* -- $addr < $TEMPLATE if [ $? -ne 0 ] ; then echo "Sending failed for email/report: $2/$3" diff --git a/s/install b/s/install index a59c8aa46..3c35112cb 100755 --- a/s/install +++ b/s/install @@ -21,7 +21,7 @@ make install [ -d $DEST/bin ] || mkdir -p $DEST/bin install -v $ROOT/process/cron/*.cron $DEST/bin/ -programs="create-orders backup-eressea run-turn" +programs="create-orders backup-eressea run-turn send-zip-report send-bz2-report" for prg in ${programs} ; do install -v $ROOT/process/$prg $DEST/bin/ done diff --git a/s/runtests b/s/runtests index 3f95da595..a0f50df1e 100755 --- a/s/runtests +++ b/s/runtests @@ -19,5 +19,6 @@ cd $ROOT $ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests.lua $ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests-e2.lua $ROOT/$BUILD/eressea/eressea -v0 scripts/run-tests-e3.lua +rm -rf data reports orders.txt cd $OLDWPD