From 119637f24cd287ed7cb7398c85b3adc37824b3b6 Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Wed, 23 Aug 2023 17:04:56 +0900 Subject: [PATCH] fix: docker entrypoint.sh --- docker/entrypoint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 180ab93..63e997b 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -58,8 +58,9 @@ EOF ####################################### function setup_ubuntu () { + id ${USER} > /dev/null # Check the existence of the user, if not exist, create it. - if [ ! $(id ${USER}) ]; then + if [ $? -eq 1 ]; then echo "rpxy: Create user ${USER} with ${USER_ID}:${GROUP_ID}" groupadd -g ${GROUP_ID} ${USER} useradd -u ${USER_ID} -g ${GROUP_ID} ${USER} @@ -81,8 +82,9 @@ function setup_ubuntu () { ####################################### function setup_alpine () { + id ${USER} > /dev/null # Check the existence of the user, if not exist, create it. - if [ ! $(id ${USER}) ]; then + if [ $? -eq 1 ]; then echo "rpxy: Create user ${USER} with ${USER_ID}:${GROUP_ID}" addgroup -g ${GROUP_ID} ${USER} adduser -H -D -u ${USER_ID} -G ${USER} ${USER}