Repaired some bugs from refactor

This commit is contained in:
Aitor Ramos Sasselli
2017-11-01 06:42:44 +01:00
parent 0c1c6d198c
commit ee5a95baa8
12 changed files with 718 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
set -e
sed -i "/^minecraft/s/:1000:1000:/:${UID}:${GID}:/g" /etc/passwd
sed -i "/^minecraft/s/:1000:/:${GID}:/g" /etc/group
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
fix_ownership() {
dir=$1
if ! su-exec minecraft test -w $dir; then
echo "Correcting writability of $dir ..."
chown -R minecraft:minecraft $dir
chmod -R u+w $dir
fi
}
fix_ownership /data
fix_ownership /home/minecraft
fi
echo "Switching to user 'minecraft'"
su-exec minecraft /start-configuration $@