From 5e2329b55f3b54bf160d35804f380f6486c24057 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:58:06 +0100 Subject: [PATCH] fix: handle non-interactive terminal scenarios in setup script --- setup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index add36343..849dc1f4 100644 --- a/setup.sh +++ b/setup.sh @@ -1028,6 +1028,12 @@ load_existing_config() { # When piped (e.g. curl | bash), reopen stdin from the terminal if [[ -t 0 ]]; then main "$@" -else +elif [[ -r /dev/tty ]] 2>/dev/null && (echo < /dev/tty) 2>/dev/null; then main "$@" < /dev/tty +else + echo "Error: No interactive terminal available." + echo "Download and run the script directly instead:" + echo " curl -fsSL https://raw.githubusercontent.com/rathlinus/jmap-webmail/main/setup.sh -o setup.sh" + echo " bash setup.sh --dry-run" + exit 1 fi