From b60120888d0d340f4f88fb2a3cf711dc732748af Mon Sep 17 00:00:00 2001 From: hoellen Date: Sun, 3 Jan 2021 13:25:23 +0100 Subject: [PATCH] Check for UID/GID and add nextcloud user --- nextcloud/rootfs/usr/local/bin/run.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nextcloud/rootfs/usr/local/bin/run.sh b/nextcloud/rootfs/usr/local/bin/run.sh index aea112c..3adf2b3 100644 --- a/nextcloud/rootfs/usr/local/bin/run.sh +++ b/nextcloud/rootfs/usr/local/bin/run.sh @@ -37,6 +37,14 @@ for dir in /nextcloud /data /config /apps2 /var/log /php /nginx /tmp /etc/s6.d; done echo "Done updating permissions." +echo "Check for UserID ${UID}" +if ! $(grep ":${UID}:" /etc/passwd 1>/dev/null 2>&1); then + echo "Creating user nextcloud with UID=${UID} and GID=${GID}." + /usr/sbin/adduser -g ${GID} -u ${UID} --disabled-password --gecos "" nextcloud +else + echo "An existing user with UID=${UID} was found, nothing to do." +fi + if [ ! -f /config/config.php ]; then # New installation, run the setup /usr/local/bin/setup.sh