From 9f452ac222837896eb05855466194ce8d8d87452 Mon Sep 17 00:00:00 2001 From: natemaia Date: Fri, 14 Dec 2018 16:39:45 -0800 Subject: [PATCH] Remove profile files in user home when not autologging in or using a dm --- src/lib/install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/install.sh b/src/lib/install.sh index c5ace01..e843122 100644 --- a/src/lib/install.sh +++ b/src/lib/install.sh @@ -252,7 +252,9 @@ EOF # add the shell login file to the edit list after install EDIT_FILES[11]+=" /home/$NEWUSER/$loginrc" - cat >> $MNT/home/$NEWUSER/$loginrc << EOF + if [[ $AUTOLOGIN == true ]]; then + sed -i "s/root/${NEWUSER}/g" $SERVICE/autologin.conf + cat >> $MNT/home/$NEWUSER/$loginrc << EOF # ~/$loginrc # sourced by $(basename $MYSHELL) when used as a login shell @@ -261,16 +263,16 @@ if [ -z "\$DISPLAY" ] && [ \$XDG_VTNR -eq 1 ]; then exec startx -- vt1 >/dev/null 2>&1 fi EOF - if [[ $AUTOLOGIN == true ]]; then - sed -i "s/root/${NEWUSER}/g" $SERVICE/autologin.conf else rm -rf $SERVICE + rm -rf $MNT/home/$NEWUSER/.{xinitrc,profile,zprofile,bash_profile} fi } setup_lightdm() { rm -rf $SERVICE + rm -rf $MNT/home/$NEWUSER/.{xinitrc,profile,zprofile,bash_profile} chrun 'systemctl set-default graphical.target && systemctl enable lightdm.service' cat > $MNT/etc/lightdm/lightdm-gtk-greeter.conf << EOF # LightDM GTK+ Configuration