mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Prevent setting keyboard language when logged in via SSH.
This commit is contained in:
parent
8d7208842b
commit
83e19f4f54
16
raspi-config
16
raspi-config
@ -54,6 +54,14 @@ is_live() {
|
|||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_ssh() {
|
||||||
|
if pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_init_sys() {
|
get_init_sys() {
|
||||||
if command -v systemctl > /dev/null && systemctl | grep -q '\-\.mount'; then
|
if command -v systemctl > /dev/null && systemctl | grep -q '\-\.mount'; then
|
||||||
SYSTEMD=1
|
SYSTEMD=1
|
||||||
@ -1493,12 +1501,20 @@ if [ -n "${OPT_MEMORY_SPLIT:-}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
do_internationalisation_menu() {
|
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 \
|
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" \
|
"I1 Change Locale" "Set up language and regional settings to match your location" \
|
||||||
"I2 Change Timezone" "Set up timezone 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" \
|
"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" \
|
"I4 Change Wi-fi Country" "Set the legal channels used in your country" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
|
fi
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user