2018-04-26 01:57:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-09-27 07:27:50 +00:00
|
|
|
umask 0002
|
|
|
|
chmod g+w /data
|
|
|
|
|
2018-07-31 02:49:43 +00:00
|
|
|
if [ $(id -u) = 0 ]; then
|
2018-08-05 21:38:22 +00:00
|
|
|
if [[ -v UID && $UID != $(id -u) ]]; then
|
2018-07-31 02:49:43 +00:00
|
|
|
usermod -u $UID minecraft
|
2018-04-26 01:57:57 +00:00
|
|
|
fi
|
2018-07-31 02:49:43 +00:00
|
|
|
if [[ -v GID ]]; then
|
2018-09-30 20:20:54 +00:00
|
|
|
groupmod -o -g $GID minecraft
|
2018-07-31 02:49:43 +00:00
|
|
|
fi
|
2018-08-18 21:56:45 +00:00
|
|
|
|
|
|
|
if [[ $(stat -c "%u" /data) != $UID ]]; then
|
|
|
|
echo "Changing ownership of /data to $UID ..."
|
|
|
|
chown -R minecraft:minecraft /data
|
|
|
|
fi
|
|
|
|
|
2018-10-23 21:00:23 +00:00
|
|
|
exec su-exec minecraft:minecraft /start-configuration $@
|
2018-07-31 02:49:43 +00:00
|
|
|
else
|
2018-10-23 21:00:23 +00:00
|
|
|
exec /start-configuration $@
|
2018-04-26 01:57:57 +00:00
|
|
|
fi
|