2020-12-10 22:16:44 +00:00
#!/bin/sh
set -e
# Create Log Folder
rm -rf /tmp/minecraft-pi
mkdir -p /tmp/minecraft-pi
# Start Logging
2021-01-28 22:04:54 +00:00
touch /tmp/minecraft-pi/main.log
tail -f /tmp/minecraft-pi/main.log &
TAIL_PID = $!
2020-12-10 22:16:44 +00:00
# Run
set +e
2021-01-28 22:04:54 +00:00
/usr/lib/minecraft-pi/run.sh > /tmp/minecraft-pi/main.log 2>& 1
2020-12-10 22:16:44 +00:00
RET = $?
set -e
# Kill Logging
2021-01-28 22:04:54 +00:00
kill ${ TAIL_PID }
2020-12-10 22:16:44 +00:00
# Handle Crash
2021-01-28 22:04:54 +00:00
if [ ${ RET } -ne 0 ] ; then
zenity --class " ${ ZENITY_CLASS } " --error --no-wrap --text 'Minecraft: Pi Edition has crashed!\nLogs are located in /tmp/minecraft-pi.\n\nExit Code: ' ${ RET }
exit ${ RET }
2020-12-10 22:16:44 +00:00
fi