minecraft-pi-reborn/debian/client/common/usr/lib/minecraft-pi/pre-launch.sh

27 lines
394 B
Bash
Raw Normal View History

#!/bin/sh
set -e
2021-01-31 02:32:20 +00:00
# Prepare Data Folder
mkdir -p "${USER_HOME}/.minecraft-pi"
# 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=$!
# Run
set +e
2021-01-28 22:04:54 +00:00
/usr/lib/minecraft-pi/run.sh > /tmp/minecraft-pi/main.log 2>&1
RET=$?
set -e
# Kill Logging
2021-01-28 22:04:54 +00:00
kill ${TAIL_PID}
2021-01-31 02:32:20 +00:00
# Exit
exit ${RET}