New bookworm install script: force read from /dev/tty, otherwise stdin is 'not what you expect' in a curl|bash context ... credits to ljf

This commit is contained in:
Alexandre Aubin 2024-01-14 16:07:06 +01:00
parent e0353f4bae
commit d95cdfd7ec

View file

@ -290,7 +290,7 @@ function confirm_installation() {
EOF
read -p " Are you sure you want to proceed (y/n) ? " choice
read -p " Are you sure you want to proceed (y/n) ? " choice < /dev/tty
choice="$(echo $choice | tr '[A-Z]' '[a-z]')"
[[ "$choice" == "yes" ]] || [[ "$choice" == "y" ]] || { error "Aborting"; return 1; }
@ -324,7 +324,7 @@ $(test -n "$ssh_port_warning" && echo -e "$ssh_port_warning")
(Note that this will only be effective *after* you run YunoHost's postinstall)
EOF
read -p " Should YunoHost override the SSH configuration (y/n) ? " choice
read -p " Should YunoHost override the SSH configuration (y/n) ? " choice < /dev/tty
choice="$(echo $choice | tr '[A-Z]' '[a-z]')"
if [[ "$choice" != "yes" ]] && [[ "$choice" != "y" ]]
then