forked from github/server
move orders.queue file (clever use of lockfile program)
This commit is contained in:
parent
197fd48508
commit
dc2663571c
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
GAME=$1
|
GAME=$1
|
||||||
TURN=$2
|
TURN=$2
|
||||||
|
|
||||||
|
@ -7,6 +9,7 @@ if [ ! -d $ERESSEA/game-$GAME ] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $ERESSEA/game-$GAME
|
cd $ERESSEA/game-$GAME
|
||||||
|
|
||||||
if [ -d orders.dir.$TURN ]; then
|
if [ -d orders.dir.$TURN ]; then
|
||||||
echo "orders.dir.$TURN already exists"
|
echo "orders.dir.$TURN already exists"
|
||||||
else
|
else
|
||||||
|
@ -14,3 +17,11 @@ else
|
||||||
mkdir -p orders.dir
|
mkdir -p orders.dir
|
||||||
fi
|
fi
|
||||||
ls -1rt orders.dir.$TURN/turn-* | xargs cat > orders.$TURN
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue