openttd-jgr/start.sh
Fábio André Damas b5ed770d81
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Fix savegame not loading and improve build
2025-06-04 20:37:26 +00:00

13 lines
354 B
Bash

#!/bin/sh
SAVE_DIR="/root/.openttd/save"
LATEST_SAVE=$(ls -rt ${SAVE_DIR}/autosave/ | tail -n1)
ABSOLUTE_SAVE="$SAVE_DIR/autosave/$LATEST_SAVE"
if [ -f "$ABSOLUTE_SAVE" ]; then
echo "Loading savegame: $LATEST_SAVE"
exec /openttd/openttd -D -g $ABSOLUTE_SAVE
else
echo "No savegame found. Starting new game."
exec /openttd/openttd -D
fi