mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-20 16:26:23 +00:00
Do this to allow write access for groups that the minecraft user is in. This commit also fixes an issue if a group is specified with $GID and it has no write access in the mounted host volume.
23 lines
442 B
Bash
Executable File
23 lines
442 B
Bash
Executable File
#!/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 -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
|