# Prevent from updating if parameters already present (persistent usb
# key)
- if ! $(grep -qs 'AutomaticLoginEnable' $GDMCustomFile)
+ if ! $(grep -qs '\[daemon\]' $GDMCustomFile)
then
- if $(grep -qs '\[daemon\]' $GDMCustomFile)
- then
- sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
- else
- echo -e "[daemon]\n$AutologinParameters" >> $GDMCustomFile
- fi
+ echo '[daemon]' >> $GDMCustomFile
fi
+
+ sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
fi
if [ -d /root/etc/default/kdm.d/ ]
/root/etc/kde4/kdm/kdmrc
fi
+if [ -f /root/etc/lxdm/lxdm.conf ]
+then
+ # Configure LXDM autologin
+ sed -i -r -e "s/^# autologin=dgod/autologin=$USERNAME/" \
+ -e "s/^# session/session/" \
+ /root/etc/lxdm/lxdm.conf
+fi
+
log_end_msg