mirror of
				https://github.com/brain-hackers/brain-config.git
				synced 2025-11-04 14:38:36 +09:00 
			
		
		
		
	Modify autologin test for compatibility with stretch and buster
This commit is contained in:
		
							
								
								
									
										15
									
								
								raspi-config
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								raspi-config
									
									
									
									
									
								
							@@ -66,6 +66,11 @@ is_ssh() {
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					deb_ver () {
 | 
				
			||||||
 | 
					  ver=`cat /etc/debian_version | cut -d . -f 1`
 | 
				
			||||||
 | 
					  echo $ver
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
calc_wt_size() {
 | 
					calc_wt_size() {
 | 
				
			||||||
  # NOTE: it's tempting to redirect stderr to /dev/null, so supress error 
 | 
					  # NOTE: it's tempting to redirect stderr to /dev/null, so supress error 
 | 
				
			||||||
  # output from tput. However in this case, tput detects neither stdout or 
 | 
					  # output from tput. However in this case, tput detects neither stdout or 
 | 
				
			||||||
@@ -918,14 +923,20 @@ get_boot_cli() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
get_autologin() {
 | 
					get_autologin() {
 | 
				
			||||||
  if [ $(get_boot_cli) -eq 0 ]; then
 | 
					  if [ $(get_boot_cli) -eq 0 ]; then
 | 
				
			||||||
    # booting to CLI - is there an autologin conf file? */
 | 
					    # booting to CLI
 | 
				
			||||||
 | 
					    # stretch or buster - is there an autologin conf file?
 | 
				
			||||||
    if [ -e /etc/systemd/system/getty@tty1.service.d/autologin.conf ] ; then
 | 
					    if [ -e /etc/systemd/system/getty@tty1.service.d/autologin.conf ] ; then
 | 
				
			||||||
      echo 0
 | 
					      echo 0
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      # stretch or earlier - check the getty service symlink for autologin
 | 
				
			||||||
 | 
					      if [ $(deb_ver) -le 9 ] && grep -q autologin /etc/systemd/system/getty.target.wants/getty@tty1.service ; then
 | 
				
			||||||
 | 
					        echo 0
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        echo 1
 | 
					        echo 1
 | 
				
			||||||
      fi
 | 
					      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=" /etc/lightdm/lightdm.conf ; then
 | 
				
			||||||
      echo 0
 | 
					      echo 0
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user