This commit is contained in:
@@ -3,12 +3,17 @@
|
||||
WEBROOT=/data/www
|
||||
PHP=${PHP:-none}
|
||||
USERNAME=${USERNAME:-theuser}
|
||||
PUID=${PUID:-1000}
|
||||
GROUPNAME=${GROUPNAME:-thegroup}
|
||||
PGID=${PGID:-1000}
|
||||
RANDOMPWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
|
||||
adduser -DH -h "${WEBROOT}" -G "nginx" -u "1000" "${USERNAME}"
|
||||
addgroup -g "${PGID}" "${GROUPNAME}"
|
||||
addgroup nginx "${GROUPNAME}"
|
||||
adduser -DH -h "${WEBROOT}" -G "${GROUPNAME}" -u "${PUID}" "${USERNAME}"
|
||||
printf '%s\n%s' "${RANDOMPWD}" "${RANDOMPWD}" | passwd "${USERNAME}"
|
||||
echo "password for the user \"${USERNAME}\" is: ${RANDOMPWD}"
|
||||
|
||||
chown "${USERNAME}:nginx" "${WEBROOT}" -R
|
||||
chown "${PUID}:${GROUPNAME}" "${WEBROOT}" -R
|
||||
find "${WEBROOT}" -type d -exec chmod 0755 {} \;
|
||||
find "${WEBROOT}" -type f -exec chmod 0644 {} \;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user