modify for "rootless"

This commit is contained in:
Jeremy McClure 2025-03-29 04:07:45 -04:00
parent d7af43f8b0
commit e6b309d047
Signed by: jeremy
GPG Key ID: CA27BD8443157067

View File

@ -3,14 +3,16 @@
PUID="${PUID:-1000}"
PGID="${PGID:-1000}"
setperms(){
echo "Setting permissions to UID:${PUID} and GID:${PGID}"
usermod -u ${PUID} minecraft > /dev/null 2>&1
groupmod -g ${PGID} minecraft > /dev/null 2>&1
chown -R ${PUID}:${PGID} /data > /dev/null 2>&1
sleep 2
setperms() {
echo "Setting permissions to UID:${PUID} and GID:${PGID}"
sudo usermod -u ${PUID} minecraft >/dev/null 2>&1
sudo groupmod -g ${PGID} minecraft >/dev/null 2>&1
sudo chown -R ${PUID}:${PGID} /data >/dev/null 2>&1
echo "DONE"
sleep 2
}
setperms
su -c "mc" minecraft
mc