From 2588622e44975b5344cbbd35ab68d0d52da5b433 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Thu, 21 Aug 2025 22:20:31 +0000 Subject: [PATCH] fix: auto-select Quick mode for non-interactive Proxmox installations When running via curl pipe, automatically use Quick installation mode instead of waiting for input that will never come --- install.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 78f36ad66..5b77b91db 100755 --- a/install.sh +++ b/install.sh @@ -44,9 +44,14 @@ safe_read() { shift 2 local read_args="$@" - if [[ -t 0 ]] && [[ -e /dev/tty ]]; then - read -p "$prompt" $read_args $var_name < /dev/tty + # Try to read from /dev/tty first (for interactive terminals) + if [[ -e /dev/tty ]]; then + read -p "$prompt" $read_args $var_name < /dev/tty 2>/dev/null || { + # If /dev/tty fails, try stdin + read -p "$prompt" $read_args $var_name + } else + # No /dev/tty available, use stdin read -p "$prompt" $read_args $var_name fi } @@ -143,12 +148,18 @@ create_lxc_container() { echo "Proxmox VE detected. Installing Pulse in a container." echo - echo "Installation mode:" - echo " 1) Quick (recommended)" - echo " 2) Advanced" - echo " 3) Cancel" - safe_read "Select [1-3]: " mode -n 1 -r - echo + # Check if we're being piped (non-interactive) + if [[ ! -t 0 ]] && [[ ! -e /dev/tty ]]; then + echo "Non-interactive mode detected. Using Quick installation." + mode="1" + else + echo "Installation mode:" + echo " 1) Quick (recommended)" + echo " 2) Advanced" + echo " 3) Cancel" + safe_read "Select [1-3]: " mode -n 1 -r + echo + fi case $mode in 3)