2016-02-27 23:10:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
usermod --uid $UID minecraft
|
|
|
|
groupmod --gid $GID minecraft
|
|
|
|
|
2016-09-10 13:22:30 +00:00
|
|
|
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
|
|
|
|
fix_ownership() {
|
|
|
|
dir=$1
|
|
|
|
if ! sudo -u minecraft test -w $dir; then
|
|
|
|
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-05-30 16:41:03 +00:00
|
|
|
exec sudo -E -u minecraft /start-minecraft "$@"
|