2018-04-26 01:57:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
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
|
|
|
|
groupmod -g $GID minecraft
|
|
|
|
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-09-21 00:56:48 +00:00
|
|
|
exec su-exec minecraft:minecraft /start-configuration
|
2018-07-31 02:49:43 +00:00
|
|
|
else
|
|
|
|
exec /start-configuration
|
2018-04-26 01:57:57 +00:00
|
|
|
fi
|