Remove profile files in user home when not autologging in or using a dm

This commit is contained in:
natemaia 2018-12-14 16:39:45 -08:00
parent a3c3ec6730
commit 9f452ac222

View File

@ -252,6 +252,8 @@ EOF
# add the shell login file to the edit list after install
EDIT_FILES[11]+=" /home/$NEWUSER/$loginrc"
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