From 486db9b6373f5a22802b9302295552b17181e181 Mon Sep 17 00:00:00 2001
From: Alberto LIVIO BECCARIA <alberto.liviobeccaria@uniupo.it>
Date: Mon, 26 Jul 2021 15:47:10 +0200
Subject: [PATCH] Impostata sessione di default in autologin

---
 bin-ubuntu/lightdm-autologin | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin-ubuntu/lightdm-autologin b/bin-ubuntu/lightdm-autologin
index c7f6955..c03950e 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
-- 
GitLab