server/process/create-orders

27 lines
431 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
GAME=$1
TURN=$2
2017-12-03 17:30:41 +01:00
if [ ! -d "$ERESSEA/game-$GAME" ] ; then
echo "No such game: $GAME"
exit 1
fi
2017-12-03 17:30:41 +01:00
cd "$ERESSEA/game-$GAME" || exit
2017-12-03 17:30:41 +01:00
if [ -d "orders.dir.$TURN" ]; then
echo "orders.dir.$TURN already exists"
exit
fi
2020-06-26 21:58:30 +02:00
rm -f "orders.$TURN"
cd orders.dir || exit
php ../../orders-php/cli.php -d "orders.db" export | tr -d '\r' > "../orders.$TURN"
cd .. || exit
mv orders.dir "orders.dir.$TURN"
mkdir -p orders.dir