From d880de0b2af31658aad6f65576548e9c9eb3ffa8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 16 Aug 2014 18:23:44 +0200 Subject: [PATCH] fix preview send script --- s/preview | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/s/preview b/s/preview index a8291a8d5..29c9c1805 100755 --- a/s/preview +++ b/s/preview @@ -85,7 +85,7 @@ let turn=$turn+1 function send() { echo "sending reports to $1" zip="$turn-$1.zip" -zip -q -u $yip $turn-$1.?r +zip -q -u $zip $turn-$1.?r email=$(grep "faction=$1:" reports.txt | cut -d: -f2 | sed 's/email=//') cat /dev/null | mutt -F $ERESSEA/etc/muttrc -s "Testauswertung Spiel $GAME Partei $1" -a $zip -- $email } @@ -142,14 +142,18 @@ case "$1" in ;; "send") shift + sent=0 + cd $TESTROOT/reports for faction in $* ; do send $faction + sent=1 done - cd $TESTROOT - if [ -e $factions ]; then - for faction in $(cat $factions) ; do - send $faction - done + if [ $sent -eq 0 ]; then + if [ -e $factions ]; then + for faction in $(cat $factions) ; do + send $faction + done + fi fi break ;;