From 4e4fd0981116929bc65281f1b7f8a4936e62be17 Mon Sep 17 00:00:00 2001 From: MasterDraco Date: Wed, 5 Mar 2025 09:58:50 +0000 Subject: [PATCH] Fix input handling for remote Transmission selection - Add debug logging to track input values - Replace regex matching with direct string comparison for better reliability - Add explicit checks for 'y' and 'Y' input values - This fixes an issue where remote mode wasn't correctly detected from user input --- install-script.sh | 3 ++- main-installer.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/install-script.sh b/install-script.sh index f24dcf1..f286254 100755 --- a/install-script.sh +++ b/install-script.sh @@ -1174,8 +1174,9 @@ echo -e "Configure connection to your Transmission client:" echo read -p "Is Transmission running on a remote server? (y/n) [n]: " input_remote +echo "DEBUG: Input received for remote in install-script.sh: '$input_remote'" # Explicitly check for "y" or "Y" response -if [[ "$input_remote" == "y" ]] || [[ "$input_remote" == "Y" ]]; then +if [ "$input_remote" = "y" ] || [ "$input_remote" = "Y" ]; then export TRANSMISSION_REMOTE=true echo -e "${GREEN}Remote Transmission selected.${NC}" else diff --git a/main-installer.sh b/main-installer.sh index b75d9fe..edcc938 100755 --- a/main-installer.sh +++ b/main-installer.sh @@ -121,7 +121,9 @@ if [ "$IS_UPDATE" = true ]; then echo read -p "Is Transmission running on a remote server? (y/n) [n]: " input_remote - if [[ $input_remote =~ ^[Yy]$ ]]; then + log "INFO" "DEBUG: Input received for remote: '$input_remote'" + # More explicit check for "y" or "Y" input + if [ "$input_remote" = "y" ] || [ "$input_remote" = "Y" ]; then export TRANSMISSION_REMOTE=true log "INFO" "Remote Transmission selected." @@ -259,7 +261,9 @@ else echo read -p "Is Transmission running on a remote server? (y/n) [n]: " input_remote - if [[ $input_remote =~ ^[Yy]$ ]]; then + log "INFO" "DEBUG: Input received for remote: '$input_remote'" + # More explicit check for "y" or "Y" input + if [ "$input_remote" = "y" ] || [ "$input_remote" = "Y" ]; then export TRANSMISSION_REMOTE=true log "INFO" "Remote Transmission selected." else