mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
94b037428e
For #416
27 lines
555 B
Bash
27 lines
555 B
Bash
#!/bin/bash
|
|
|
|
umask 0002
|
|
chmod g+w /data
|
|
|
|
if [ $(id -u) = 0 ]; then
|
|
if [[ -v UID && $UID != $(id -u) ]]; then
|
|
usermod -u $UID minecraft
|
|
fi
|
|
if [[ -v GID ]]; then
|
|
groupmod -o -g $GID minecraft
|
|
fi
|
|
|
|
if [[ $(stat -c "%u" /data) != $UID ]]; then
|
|
echo "Changing ownership of /data to $UID ..."
|
|
chown -R minecraft:minecraft /data
|
|
fi
|
|
|
|
if [[ ${SKIP_NSSWITCH_CONF^^} != TRUE ]]; then
|
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
|
fi
|
|
|
|
exec su-exec minecraft:minecraft /start-configuration $@
|
|
else
|
|
exec /start-configuration $@
|
|
fi
|