forked from github/server
28 lines
480 B
Bash
Executable File
28 lines
480 B
Bash
Executable File
#!/bin/bash
|
|
|
|
GAME=$1
|
|
TURN=$2
|
|
|
|
if [ ! -d $ERESSEA/game-$GAME ] ; then
|
|
echo "No such game: $GAME"
|
|
exit 1
|
|
fi
|
|
|
|
cd $ERESSEA/game-$GAME
|
|
|
|
if [ -d orders.dir.$TURN ]; then
|
|
echo "orders.dir.$TURN already exists"
|
|
else
|
|
mv orders.dir orders.dir.$TURN
|
|
mkdir -p orders.dir
|
|
fi
|
|
ls -1rt orders.dir.$TURN/turn-* | xargs cat > orders.$TURN
|
|
|
|
if [ -e orders.queue ] ; then
|
|
lockfile -r3 -l120 orders.queue.lock
|
|
mv orders.queue orders.dir.$TURN/orders.queue
|
|
rm -f orders.queue.lock
|
|
fi
|
|
|
|
|