aboutsummaryrefslogtreecommitdiff
path: root/src/common-utils/main.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/common-utils/main.sh')
-rw-r--r--src/common-utils/main.sh3
1 files changed, 3 insertions, 0 deletions
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