From f2284a9cdf058654add41b19ecea473ba1f1fc38 Mon Sep 17 00:00:00 2001 From: bunker-admin Date: Wed, 25 Mar 2026 19:45:29 -0600 Subject: [PATCH] Fix curl|bash install: redirect stdin from /dev/tty for interactive prompts When piped (curl | bash), stdin is the curl output, not the terminal. All read prompts in config.sh were reading leftover pipe data or EOF, causing infinite password validation loops and garbage domain values. Bunker Admin --- config.sh | 13 +++++++++++++ scripts/install.sh | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config.sh b/config.sh index 4c00cff..2afd2ac 100755 --- a/config.sh +++ b/config.sh @@ -32,6 +32,19 @@ else RED='' GREEN='' YELLOW='' BLUE='' CYAN='' BOLD='' DIM='' NC='' fi +# ============================================================================= +# Ensure stdin is connected to the terminal (handles curl | bash case) +# ============================================================================= +if [[ ! -t 0 ]]; then + if [[ -e /dev/tty ]]; then + exec 0&2 + echo " Download and run manually: bash config.sh" >&2 + exit 1 + fi +fi + # ============================================================================= # Utility Functions # ============================================================================= diff --git a/scripts/install.sh b/scripts/install.sh index 9187ec8..765a453 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -224,7 +224,13 @@ echo "" echo -e "${BOLD}Starting configuration wizard...${NC}" echo "" cd "$INSTALL_DIR" -bash config.sh +# Redirect stdin from terminal — when piped (curl | bash), stdin is the pipe, +# so interactive prompts in config.sh would read garbage instead of user input. +if [[ -e /dev/tty ]]; then + bash config.sh