From 8de2d983dae1128ed4ce109d5e4a5d51bb8abaa9 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 8 Apr 2022 16:06:43 +0200 Subject: [PATCH] Copy the profiles for the new users only. --- 02_userconf.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/02_userconf.sh b/02_userconf.sh index 9831fe2..467cd3b 100644 --- a/02_userconf.sh +++ b/02_userconf.sh @@ -64,7 +64,10 @@ if [ "$USERID" -ne 1000 ] elif [ "$USER" != "$DEFAULT_USER" ] then ## cannot move home folder when it's a shared volume, have to copy and change permissions instead - cp -r /home/$DEFAULT_USER/.??* /home/$USER || true + if ! [ -f /home/$USER/.profile ] + then + cp -r /home/$DEFAULT_USER/.??* /home/$USER || true + fi ## RENAME the user usermod -l $USER -d /home/$USER $DEFAULT_USER groupmod -n $USER $DEFAULT_USER