From 84c72fcb50f2e4072f1ac4269df7cfb6227595e2 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 26 Jul 2021 15:57:42 +0300 Subject: [PATCH] Fix install script (check_create_scodoc_user) --- tools/utils.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/utils.sh b/tools/utils.sh index 93f45c5c..4cff511a 100644 --- a/tools/utils.sh +++ b/tools/utils.sh @@ -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