Copy the profiles for the new users only.

This commit is contained in:
Andrea Dell'Amico 2022-04-08 16:06:43 +02:00
parent ba454de833
commit 8de2d983da
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 4 additions and 1 deletions

View File

@ -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