From c3284bdf2b8d3f78dc620a82960c65a3919d4754 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 27 Jun 2020 21:42:33 +0200 Subject: [PATCH] fix create-orders script so it works with full pathnames --- process/create-orders | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/process/create-orders b/process/create-orders index 32e29c82e..ef1e1a62c 100755 --- a/process/create-orders +++ b/process/create-orders @@ -10,19 +10,20 @@ fi cd "$ERESSEA/game-$GAME" || exit +lockfile -r3 -l120 orders.queue.lock if [ -d "orders.dir.$TURN" ]; then echo "orders.dir.$TURN already exists" -else - mv orders.dir "orders.dir.$TURN" - mkdir -p orders.dir + exit fi - 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 -if [ -e orders.queue ] ; then - mv orders.queue "orders.queue.bak.$TURN" -fi + +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 + rm -f orders.queue.lock -