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
|
|
|
|
|
2020-06-27 16:59:16 +02:00
|
|
|
BINDIR="$ERESSEA/server/bin"
|
|
|
|
|
2017-12-03 15:43:22 +01:00
|
|
|
GAME="$ERESSEA/game-$1"
|
2020-06-27 16:59:16 +02:00
|
|
|
GAME_NAME=$("$BINDIR/inifile" "$GAME/eressea.ini" get game:name)
|
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
|
2020-06-27 16:59:16 +02:00
|
|
|
"$BINDIR/compress.py" "$TURN" "$GAME_NAME"
|
2017-12-03 15:43:22 +01:00
|
|
|
cd - || exit
|
|
|
|
|