openttd-jgr/start.sh

14 lines
354 B
Bash
Raw Permalink Normal View History

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