mirror of
				https://github.com/brain-hackers/brain-config.git
				synced 2025-11-04 14:38:36 +09:00 
			
		
		
		
	Modify sed strings for autologin detection to make them more robust against unexpected file contents.
This commit is contained in:
		@@ -797,7 +797,7 @@ get_autologin() {
 | 
				
			|||||||
    fi
 | 
					    fi
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    # booting to desktop - check the autologin for lightdm */
 | 
					    # booting to desktop - check the autologin for lightdm */
 | 
				
			||||||
    if grep -q "^autologin-user=" /etc/lightdm/lightdm.conf ; then
 | 
					    if grep -q "^autologin-user=pi" /etc/lightdm/lightdm.conf ; then
 | 
				
			||||||
      echo 0
 | 
					      echo 0
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      echo 1
 | 
					      echo 1
 | 
				
			||||||
@@ -846,7 +846,7 @@ do_boot_behaviour() {
 | 
				
			|||||||
          else
 | 
					          else
 | 
				
			||||||
            update-rc.d lightdm enable 2
 | 
					            update-rc.d lightdm enable 2
 | 
				
			||||||
          fi
 | 
					          fi
 | 
				
			||||||
          sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=pi/#autologin-user=/"
 | 
					          sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/"
 | 
				
			||||||
          disable_raspi_config_at_boot
 | 
					          disable_raspi_config_at_boot
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
          whiptail --msgbox "Do sudo apt-get install lightdm to allow configuration of boot to desktop" 20 60 2
 | 
					          whiptail --msgbox "Do sudo apt-get install lightdm to allow configuration of boot to desktop" 20 60 2
 | 
				
			||||||
@@ -862,7 +862,7 @@ do_boot_behaviour() {
 | 
				
			|||||||
            else
 | 
					            else
 | 
				
			||||||
              update-rc.d lightdm enable 2
 | 
					              update-rc.d lightdm enable 2
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
            sed /etc/lightdm/lightdm.conf -i -e "s/^#autologin-user=.*/autologin-user=pi/"
 | 
					            sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=pi/"
 | 
				
			||||||
            disable_raspi_config_at_boot
 | 
					            disable_raspi_config_at_boot
 | 
				
			||||||
          else
 | 
					          else
 | 
				
			||||||
            whiptail --msgbox "The pi user has been removed, can't set up boot to desktop" 20 60 2
 | 
					            whiptail --msgbox "The pi user has been removed, can't set up boot to desktop" 20 60 2
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user