2015-09-10 16:01:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-12-03 15:43:22 +01:00
|
|
|
if [ -z "$ERESSEA" ]; then
|
2015-09-10 16:01:29 +02:00
|
|
|
echo "You need to define the \$ERESSEA environment variable to run $0"
|
2019-07-31 08:43:23 +02:00
|
|
|
exit 2
|
2015-09-10 16:01:29 +02:00
|
|
|
fi
|
|
|
|
|
2017-12-03 15:43:22 +01:00
|
|
|
GAME="$ERESSEA/game-$1"
|
|
|
|
GAME_NAME=$(grep -w name "$GAME/eressea.ini" | sed 's/.*=\s*//')
|
2015-09-10 16:01:29 +02:00
|
|
|
|
|
|
|
TURN=$2
|
2017-12-03 15:43:22 +01:00
|
|
|
if [ -z "$TURN" ]
|
2015-09-10 16:01:29 +02:00
|
|
|
then
|
2017-12-03 15:43:22 +01:00
|
|
|
TURN=$(cat "$GAME/turn")
|
2015-09-10 16:01:29 +02:00
|
|
|
fi
|
|
|
|
|
2017-12-03 15:43:22 +01:00
|
|
|
if [ ! -d "$GAME/reports" ]; then
|
2015-09-10 16:01:29 +02:00
|
|
|
echo "cannot find reports directory in $GAME"
|
2019-07-31 08:43:23 +02:00
|
|
|
exit 1
|
2015-09-10 16:01:29 +02:00
|
|
|
fi
|
|
|
|
|
2017-12-03 15:43:22 +01:00
|
|
|
cd "$GAME/reports" || exit
|
|
|
|
"$ERESSEA/server/bin/compress.py" "$TURN" "$GAME_NAME"
|
|
|
|
cd - || exit
|
|
|
|
|