docker-minecraft-server/minecraft-server/start.sh
Geoff Bourne 46c865a123 Only create /home/minecraft if absent
* only download/build Spigot/Bukkit when absent
* refactored download ops into functions
#72
2016-04-24 07:26:26 -05:00

20 lines
372 B
Bash
Executable File

#!/bin/sh
set -e
usermod --uid $UID minecraft
groupmod --gid $GID minecraft
chown -R minecraft:minecraft /data /start-minecraft
chmod -R g+wX /data /start-minecraft
while lsof -- /start-minecraft; do
echo -n "."
sleep 1
done
mkdir -p /home/minecraft
chown minecraft: /home/minecraft
echo "Switching to user 'minecraft'"
exec sudo -E -u minecraft /start-minecraft