don't kill xwords; it'll exit when it's done

This commit is contained in:
Andy2 2011-10-07 18:51:27 -07:00
parent da5da3dd89
commit febf32040e

View file

@ -22,7 +22,7 @@ for NUM in $(seq 1 2); do
LOG=$DIR/game_${NUM}.log
$APP $COMMON_ARGS --file $DIR/game_${NUM}.xwg > /dev/null 2>$LOG &
PID1=$!
sleep 2
sleep 4
kill $PID1
wait $PID1
done
@ -30,30 +30,30 @@ done
# run apps until done
NBS=$DIR/nbs
ZERO_COUNT=0
while [ $ZERO_COUNT -lt 5 ]; do
while [ $ZERO_COUNT -lt 2 ]; do
WORK_DONE=""
for NUM in $(seq 1 2); do
LOG=$DIR/game_${NUM}.log
RELAYID=$(./scripts/relayID.sh --short $LOG)
MSG_COUNT=$(../relay/rq -m $RELAYID 2>/dev/null | sed 's,^.*-- ,,')
if [ "$MSG_COUNT" -gt 0 ]; then
echo "*** $MSG_COUNT messages available ***"
WORK_DONE=true
$APP $COMMON_ARGS --file $DIR/game_${NUM}.xwg \
--with-nbs $NBS > /dev/null &
PID1=$!
sleep 1 # let server get ready
../relay/rq -f $RELAYID -b $NBS
sleep 2
kill $PID1 && wait $PID1 || true
wait $PID1 || true
else
sleep 1
fi
done
[ -z "$WORK_DONE" ] && ZERO_COUNT=$((ZERO_COUNT+1))
if [ -z "$WORK_DONE" ]; then
ZERO_COUNT=$((ZERO_COUNT+1))
fi
done
echo "$0 done (pid: $PID)"