fix create-orders script so it works with full pathnames

This commit is contained in:
Enno Rehling 2020-06-27 21:42:33 +02:00
parent de40103a2e
commit c3284bdf2b
1 changed files with 11 additions and 10 deletions

View File

@ -10,19 +10,20 @@ fi
cd "$ERESSEA/game-$GAME" || exit cd "$ERESSEA/game-$GAME" || exit
lockfile -r3 -l120 orders.queue.lock
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 exit
mv orders.dir "orders.dir.$TURN"
mkdir -p orders.dir
fi fi
rm -f "orders.$TURN" rm -f "orders.$TURN"
php ../../orders-php/cli.php -d "orders.dir.$TURN/orders.db" export | tr -d '\r' > "../orders.$TURN"
lockfile -r3 -l120 orders.queue.lock cd orders.dir || exit
if [ -e orders.queue ] ; then
mv orders.queue "orders.queue.bak.$TURN" php ../../orders-php/cli.php -d "orders.db" export | tr -d '\r' > "../orders.$TURN"
fi
cd .. || exit
mv orders.dir "orders.dir.$TURN"
mkdir -p orders.dir
rm -f orders.queue.lock rm -f orders.queue.lock