Fix install script (check_create_scodoc_user)

This commit is contained in:
Emmanuel Viennet 2021-07-26 15:57:42 +03:00
parent d45f9e25cc
commit 84c72fcb50

View File

@ -61,10 +61,11 @@ init_postgres_user() { # run as root
# --- Ensure Unix user "scodoc" exists
check_create_scodoc_user() {
if [ $(id -u "${SCODOC_USER}" &> /dev/null) ]
id -u "${SCODOC_USER}" &> /dev/null
if [ "$?" != 0 ]
then
echo "Creating unix user ${SCODOC_USER}"
adduser --no-create-home --shell /bin/bash --gecos "ScoDoc service" ${SCODOC_USER} || die "failed to create user"
adduser --no-create-home --shell /bin/bash --gecos "ScoDoc service" "${SCODOC_USER}" || die "failed to create user"
else
echo "Unix user ${SCODOC_USER} exists"
fi