2016-02-27 23:10:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
2017-04-05 03:11:05 +00:00
|
|
|
sed -i "/^minecraft/s/:1000:1000:/:${UID}:${GID}:/g" /etc/passwd
|
|
|
|
sed -i "/^minecraft/s/:1000:/:${GID}:/g" /etc/group
|
2016-02-27 23:10:11 +00:00
|
|
|
|
2016-09-10 13:22:30 +00:00
|
|
|
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
|
|
|
|
fix_ownership() {
|
|
|
|
dir=$1
|
2016-12-06 22:31:06 +00:00
|
|
|
if ! su-exec minecraft test -w $dir; then
|
2016-09-10 13:22:30 +00:00
|
|
|
echo "Correcting writability of $dir ..."
|
|
|
|
chown -R minecraft:minecraft $dir
|
|
|
|
chmod -R u+w $dir
|
|
|
|
fi
|
|
|
|
}
|
2016-02-27 23:10:11 +00:00
|
|
|
|
2016-09-10 13:22:30 +00:00
|
|
|
fix_ownership /data
|
|
|
|
fix_ownership /home/minecraft
|
|
|
|
fi
|
2016-04-24 03:23:55 +00:00
|
|
|
|
|
|
|
echo "Switching to user 'minecraft'"
|
2016-12-06 22:31:06 +00:00
|
|
|
su-exec minecraft /start-minecraft $@
|