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,7 +252,9 @@ EOF
# add the shell login file to the edit list after install # add the shell login file to the edit list after install
EDIT_FILES[11]+=" /home/$NEWUSER/$loginrc" 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 # ~/$loginrc
# sourced by $(basename $MYSHELL) when used as a login shell # 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 exec startx -- vt1 >/dev/null 2>&1
fi fi
EOF EOF
if [[ $AUTOLOGIN == true ]]; then
sed -i "s/root/${NEWUSER}/g" $SERVICE/autologin.conf
else else
rm -rf $SERVICE rm -rf $SERVICE
rm -rf $MNT/home/$NEWUSER/.{xinitrc,profile,zprofile,bash_profile}
fi fi
} }
setup_lightdm() setup_lightdm()
{ {
rm -rf $SERVICE rm -rf $SERVICE
rm -rf $MNT/home/$NEWUSER/.{xinitrc,profile,zprofile,bash_profile}
chrun 'systemctl set-default graphical.target && systemctl enable lightdm.service' chrun 'systemctl set-default graphical.target && systemctl enable lightdm.service'
cat > $MNT/etc/lightdm/lightdm-gtk-greeter.conf << EOF cat > $MNT/etc/lightdm/lightdm-gtk-greeter.conf << EOF
# LightDM GTK+ Configuration # LightDM GTK+ Configuration