minecraft-pi-docker/debian/client/common/usr/lib/minecraft-pi/pre-launch.sh
2021-02-28 15:35:04 -05:00

27 lines
416 B
Bash
Executable File

#!/bin/sh
set -e
# Prepare Data Folder
mkdir -p "${USER_HOME}/.minecraft-pi"
# Create Log Folder
rm -rf /tmp/minecraft-pi
mkdir -p /tmp/minecraft-pi
# Start Logging
touch /tmp/minecraft-pi/main.log
tail -f /tmp/minecraft-pi/main.log &
TAIL_PID=$!
# Run
set +e
/usr/lib/minecraft-pi/run.sh > /tmp/minecraft-pi/main.log 2>&1
RET=$?
set -e
# Kill Logging
kill ${TAIL_PID} > /dev/null 2>&1 || :
# Exit
exit ${RET}