From 863291d7123d37fbce286b1d1ea083618b4dc510 Mon Sep 17 00:00:00 2001 From: iam-joey Date: Wed, 8 Apr 2026 10:28:22 +0530 Subject: [PATCH 1/3] fix: redirect stdin to /dev/tty for interactive read commands in piped execution --- setup_payram.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup_payram.sh b/setup_payram.sh index d165337..694b918 100755 --- a/setup_payram.sh +++ b/setup_payram.sh @@ -3713,6 +3713,10 @@ check_existing_installation() { # Main execution flow main() { + # When the script is piped (curl | bash), stdin is the pipe — not the terminal. + # Redirect stdin to /dev/tty so all interactive read commands work correctly. + [[ -t 0 ]] || exec < /dev/tty + # Initialize logging safely init_logging From 84c06ee921869928028fae2b448ddf6502fa7e09 Mon Sep 17 00:00:00 2001 From: iam-joey Date: Wed, 8 Apr 2026 11:19:44 +0530 Subject: [PATCH 2/3] fix: ensure script exits cleanly with status 0 after execution --- setup_payram.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_payram.sh b/setup_payram.sh index 694b918..a9fb181 100755 --- a/setup_payram.sh +++ b/setup_payram.sh @@ -3925,5 +3925,6 @@ main() { # Execute main function with all arguments main "$@" +exit 0 From 8d6fe7934adb83a68e1407b823df318b3fc8b382 Mon Sep 17 00:00:00 2001 From: iam-joey Date: Wed, 8 Apr 2026 11:45:27 +0530 Subject: [PATCH 3/3] fix: redirect stdin to /dev/tty for interactive prompts to ensure proper user input handling --- setup_payram.sh | 86 +++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/setup_payram.sh b/setup_payram.sh index a9fb181..0003d82 100755 --- a/setup_payram.sh +++ b/setup_payram.sh @@ -772,7 +772,7 @@ check_disk_space_requirements() { while true; do print_color "yellow" "Do you want to continue anyway? (y/N): " - read -r response + read -r response /dev/null 2>&1; then print_color "green" "ℹ️ Valid certificate already exists for $new_domain" - read -e -p " Force-renew anyway? (y/N): " force_renew + read -e -p " Force-renew anyway? (y/N): " force_renew