OpenTTD/os/debian/openttd-wrapper
rubidium eb8263ce50 (svn r19175) [1.0] -Backport from trunk:
- Change: Do not print the absolute path to AI script files in the AI debug window, use the relative path from /ai/ instead (r19166)
- Change: The Debian packaging; bring it in sync with the packaging used at Debian excluding package splitting (r19162)
- Fix: Buoys are no Stations, only BaseStations (r19174)
- Fix: Under some circumstances timidity (via extmidi) would not shut down properly causing all kinds of trouble (e.g. blocked audio output). Try harder to shut down timidity and first shut down the music so shut down order is the inverse of initialisation order (r19168)
- Fix: Industry 0 could be choosen even if not available [FS#3631] (r19167)
- Fix: Vehicle running costs should not be changed in a running game [FS#3629] (r19165)
2010-02-20 21:10:58 +00:00

27 lines
709 B
Bash

#!/bin/sh
# This is a wrapper script that checks openttd's exit status and
# displays its stderr output
# Get a file to capture stderr to
TMPFILE=`mktemp --tmpdir openttd.errout.XXXXXXXXX`
if [ ! -w "$TMPFILE" ]; then
xmessage "Could not create temporary file for error messages. Not starting OpenTTD."
exit 1;
fi
# Capture stderr
openttd "$@" 2> "$TMPFILE"
ERRCODE=$?
if [ "$ERRCODE" -ne 0 ]; then
CODEMSG="OpenTTD returned with error code $ERRCODE."
if [ -s "$TMPFILE" ]; then
MESSAGE="$CODEMSG The following error messages were produced:\n\n"
printf "$MESSAGE" | cat - "$TMPFILE" | fold -s | xmessage -file -
else
xmessage "$CODEMSG No error messages were produced."
fi
fi
rm -f "$TMPFILE"