Only redirect from /dev/tty if stdin is not already a tty
@@ -135,7 +135,7 @@ main() {
exit 1
fi
- if [ "$need_tty" = "yes" ]; then
+ if [ "$need_tty" = "yes" ] && [ ! -t 0 ]; then
# The installer is going to want to ask for confirmation by
# reading stdin. This script was piped into `sh` though and
# doesn't have stdin to pass to its children. Instead we're going
