mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
don't kill xwords; it'll exit when it's done
This commit is contained in:
parent
da5da3dd89
commit
febf32040e
1 changed files with 7 additions and 7 deletions
|
@ -22,7 +22,7 @@ for NUM in $(seq 1 2); do
|
||||||
LOG=$DIR/game_${NUM}.log
|
LOG=$DIR/game_${NUM}.log
|
||||||
$APP $COMMON_ARGS --file $DIR/game_${NUM}.xwg > /dev/null 2>$LOG &
|
$APP $COMMON_ARGS --file $DIR/game_${NUM}.xwg > /dev/null 2>$LOG &
|
||||||
PID1=$!
|
PID1=$!
|
||||||
sleep 2
|
sleep 4
|
||||||
kill $PID1
|
kill $PID1
|
||||||
wait $PID1
|
wait $PID1
|
||||||
done
|
done
|
||||||
|
@ -30,30 +30,30 @@ done
|
||||||
# run apps until done
|
# run apps until done
|
||||||
NBS=$DIR/nbs
|
NBS=$DIR/nbs
|
||||||
ZERO_COUNT=0
|
ZERO_COUNT=0
|
||||||
while [ $ZERO_COUNT -lt 5 ]; do
|
while [ $ZERO_COUNT -lt 2 ]; do
|
||||||
WORK_DONE=""
|
WORK_DONE=""
|
||||||
for NUM in $(seq 1 2); do
|
for NUM in $(seq 1 2); do
|
||||||
LOG=$DIR/game_${NUM}.log
|
LOG=$DIR/game_${NUM}.log
|
||||||
RELAYID=$(./scripts/relayID.sh --short $LOG)
|
RELAYID=$(./scripts/relayID.sh --short $LOG)
|
||||||
MSG_COUNT=$(../relay/rq -m $RELAYID 2>/dev/null | sed 's,^.*-- ,,')
|
MSG_COUNT=$(../relay/rq -m $RELAYID 2>/dev/null | sed 's,^.*-- ,,')
|
||||||
if [ "$MSG_COUNT" -gt 0 ]; then
|
if [ "$MSG_COUNT" -gt 0 ]; then
|
||||||
|
echo "*** $MSG_COUNT messages available ***"
|
||||||
WORK_DONE=true
|
WORK_DONE=true
|
||||||
|
|
||||||
$APP $COMMON_ARGS --file $DIR/game_${NUM}.xwg \
|
$APP $COMMON_ARGS --file $DIR/game_${NUM}.xwg \
|
||||||
--with-nbs $NBS > /dev/null &
|
--with-nbs $NBS > /dev/null &
|
||||||
PID1=$!
|
PID1=$!
|
||||||
|
|
||||||
sleep 1 # let server get ready
|
|
||||||
|
|
||||||
../relay/rq -f $RELAYID -b $NBS
|
../relay/rq -f $RELAYID -b $NBS
|
||||||
|
|
||||||
sleep 2
|
wait $PID1 || true
|
||||||
kill $PID1 && wait $PID1 || true
|
|
||||||
else
|
else
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[ -z "$WORK_DONE" ] && ZERO_COUNT=$((ZERO_COUNT+1))
|
if [ -z "$WORK_DONE" ]; then
|
||||||
|
ZERO_COUNT=$((ZERO_COUNT+1))
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$0 done (pid: $PID)"
|
echo "$0 done (pid: $PID)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue