diff --git a/bin-ubuntu/lightdm-autologin b/bin-ubuntu/lightdm-autologin index c7f6955964c07cbd04cc8fae7817dd8657f45807..c03950e9fef28f78a04c0bffe626f342c8e2b36c 100755 --- a/bin-ubuntu/lightdm-autologin +++ b/bin-ubuntu/lightdm-autologin @@ -1,8 +1,10 @@ #!/bin/bash clear() { + # comment again the lines to disable autologin sed -i '/autologin-user=/s/^#*/#/' /etc/lightdm/lightdm.conf sed -i '/session-cleanup-script=/s/^#*/#/' /etc/lightdm/lightdm.conf + sed -i '/autologin-session=/s/^#*/#/' /etc/lightdm/lightdm.conf } dm_restart() { @@ -23,8 +25,10 @@ start() { # So, one solution is the following: SEDCMD="/#*autologin-user=.*/s/"'.*'"/autologin-user=$ESAME_USER/" sed -i "$SEDCMD" /etc/lightdm/lightdm.conf - # enable auto-relogin (remove the comment in the file) + # enable auto-relogin (uncomment the line in the file) sed -i '/session-cleanup-script=/s/^#*//' /etc/lightdm/lightdm.conf + # enable autologin default session (uncomment the line in the file) + sed -i '/autologin-session=/s/^#*//' /etc/lightdm/lightdm.conf #sleep 5 dm_restart