From e6b309d0477f6cf12c99c559f468537863bf5c02 Mon Sep 17 00:00:00 2001 From: Jeremy McClure Date: Sat, 29 Mar 2025 04:07:45 -0400 Subject: [PATCH] modify for "rootless" --- scripts/init | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/init b/scripts/init index 6d18578..d262a3a 100644 --- a/scripts/init +++ b/scripts/init @@ -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 \ No newline at end of file +mc +