Prevent setting keyboard language when logged in via SSH.

This commit is contained in:
Simon Long 2017-01-27 15:29:05 +00:00
parent 8d7208842b
commit 83e19f4f54

View File

@ -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