From e7f7d194d634e86b29ed2b74a35dd3c24fa1f7a5 Mon Sep 17 00:00:00 2001 From: Pablo Ulloa Date: Wed, 27 Sep 2023 15:45:29 -0300 Subject: [common-utils] fix bug when user home is custom by base docker (#703) * [common-utils] fix bug when user home is custom by base docker * bumped minor version * reduced conditions to improve readability --- src/common-utils/main.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common-utils/main.sh') diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 4a048db..7142246 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -407,6 +407,9 @@ fi if [ "${USERNAME}" = "root" ]; then user_home="/root" +# Check if user already has a home directory other than /home/${USERNAME} +elif [ "/home/${USERNAME}" != $( getent passwd $USERNAME | cut -d: -f6 ) ]; then + user_home=$( getent passwd $USERNAME | cut -d: -f6 ) else user_home="/home/${USERNAME}" if [ ! -d "${user_home}" ]; then -- cgit v1.2.3