mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 22:02:28 +00:00
a316bd8f95
Environment variable replacement now only affects matching file types. Closes #299
22 lines
451 B
Bash
22 lines
451 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
|
|
|
|
exec su-exec minecraft:minecraft /start-configuration $@
|
|
else
|
|
exec /start-configuration $@
|
|
fi
|