From d76c572af8ae03367234d4ee7756db3dfe9001e9 Mon Sep 17 00:00:00 2001 From: constantprojects Date: Tue, 24 Feb 2026 08:52:48 -0700 Subject: [PATCH] Fix stdin: use targeted /dev/tty redirects instead of exec The exec < /dev/tty approach silently killed the script under set -e if /dev/tty wasn't accessible. Replace with surgical redirects on just the interactive reads and setup.sh invocation. Co-Authored-By: Claude Opus 4.6 --- install.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index fc487e0..2f89f4a 100755 --- a/install.sh +++ b/install.sh @@ -50,13 +50,6 @@ show_progress() { fi } -# --- Reclaim stdin for interactive prompts --- -# When run via `curl ... | bash`, stdin is the pipe. Reopen it from -# the terminal so read prompts (setup wizard, confirmations) work. -if [ ! -t 0 ]; then - exec < /dev/tty -fi - header "WebsiteBox Installer" # --- Check for root/sudo --- @@ -102,7 +95,7 @@ case "$OS_ID" in *) warn "Unsupported OS detected (${OS_ID} ${OS_VERSION})." warn "WebsiteBox is tested on Ubuntu 20.04+ and Debian 11+." - read -rp "Continue anyway? (y/N) " cont + read -rp "Continue anyway? (y/N) " cont < /dev/tty if [ "$cont" != "y" ] && [ "$cont" != "Y" ]; then exit 1 fi @@ -257,9 +250,9 @@ echo "" if [ "$DOCKER_JUST_INSTALLED" = true ] && [ "$ACTUAL_USER" != "root" ]; then # Activate docker group for this session without requiring logout/login info "Activating Docker permissions for current session..." - sg docker -c "./setup.sh" + sg docker -c "./setup.sh < /dev/tty" else - ./setup.sh + ./setup.sh < /dev/tty fi echo ""