12 lines
379 B
Bash
Executable File
12 lines
379 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "# Creating user and group"
|
|
|
|
RANDOMPWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
|
|
|
|
addgroup -g "${PGID}" "${GROUPNAME}"
|
|
addgroup nginx "${GROUPNAME}"
|
|
adduser -DH -h "${PATH_WEBROOT}" -G "${GROUPNAME}" -u "${PUID}" "${USERNAME}"
|
|
printf '%s\n%s' "${RANDOMPWD}" "${RANDOMPWD}" | passwd "${USERNAME}"
|
|
echo "password for the user \"${USERNAME}\" is: ${RANDOMPWD}"
|