mc: chown /data when it doesn't match $UID

Fixes #239
This commit is contained in:
Geoff Bourne
2018-08-18 16:56:45 -05:00
parent f65548894f
commit 1c5e4b17bf
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -7,6 +7,12 @@ if [ $(id -u) = 0 ]; then
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
su-exec minecraft:minecraft /start-configuration
else
exec /start-configuration