mirror of
				https://github.com/brain-hackers/brain-config.git
				synced 2025-11-04 06:28:39 +09:00 
			
		
		
		
	Prevent setting keyboard language when logged in via SSH.
This commit is contained in:
		
							
								
								
									
										16
									
								
								raspi-config
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								raspi-config
									
									
									
									
									
								
							@@ -54,6 +54,14 @@ is_live() {
 | 
			
		||||
    return $?
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
is_ssh() {
 | 
			
		||||
  if pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
 | 
			
		||||
    return 0
 | 
			
		||||
  else
 | 
			
		||||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
get_init_sys() {
 | 
			
		||||
  if command -v systemctl > /dev/null && systemctl | grep -q '\-\.mount'; then
 | 
			
		||||
    SYSTEMD=1
 | 
			
		||||
@@ -1493,12 +1501,20 @@ if [ -n "${OPT_MEMORY_SPLIT:-}" ]; then
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
do_internationalisation_menu() {
 | 
			
		||||
  if is_ssh ; then
 | 
			
		||||
  FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Localisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
 | 
			
		||||
    "I1 Change Locale" "Set up language and regional settings to match your location" \
 | 
			
		||||
    "I2 Change Timezone" "Set up timezone to match your location" \
 | 
			
		||||
    "I4 Change Wi-fi Country" "Set the legal channels used in your country" \
 | 
			
		||||
    3>&1 1>&2 2>&3)
 | 
			
		||||
  else
 | 
			
		||||
  FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Localisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
 | 
			
		||||
    "I1 Change Locale" "Set up language and regional settings to match your location" \
 | 
			
		||||
    "I2 Change Timezone" "Set up timezone to match your location" \
 | 
			
		||||
    "I3 Change Keyboard Layout" "Set the keyboard layout to match your keyboard" \
 | 
			
		||||
    "I4 Change Wi-fi Country" "Set the legal channels used in your country" \
 | 
			
		||||
    3>&1 1>&2 2>&3)
 | 
			
		||||
  fi
 | 
			
		||||
  RET=$?
 | 
			
		||||
  if [ $RET -eq 1 ]; then
 | 
			
		||||
    return 0
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user