docker-minecraft-server/minecraft-server/start.sh

20 lines
369 B
Bash
Raw Normal View History

2016-02-27 23:10:11 +00:00
#!/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 /home/minecraft
chown minecraft: /home/minecraft
echo "Switching to user 'minecraft'"
exec sudo -E -u minecraft /start-minecraft