From 313c85ee4ba0af63a0154fb97842b94cd65300a2 Mon Sep 17 00:00:00 2001 From: MasterDraco Date: Mon, 10 Mar 2025 17:04:13 +0000 Subject: [PATCH] Fix Transmission installation detection in update mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Skip Transmission daemon installation prompt when in update mode - Properly detect remote/local status from existing config file - Add better logging for Transmission configuration detection 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- modules/dependencies-module.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) mode change 100644 => 100755 modules/dependencies-module.sh diff --git a/modules/dependencies-module.sh b/modules/dependencies-module.sh old mode 100644 new mode 100755 index 8369385..119a23b --- a/modules/dependencies-module.sh +++ b/modules/dependencies-module.sh @@ -19,6 +19,24 @@ function install_dependencies() { log "INFO" "Loaded transmission settings from absolute path: TRANSMISSION_REMOTE=$TRANSMISSION_REMOTE" fi + # If we're in update mode, try to load the remote status from existing config + if [ "$IS_UPDATE" = "true" ] && [ -n "$EXISTING_CONFIG_PATH" ]; then + log "INFO" "Update mode detected with config at $EXISTING_CONFIG_PATH, checking Transmission remote setting" + if [ -f "$EXISTING_CONFIG_PATH" ]; then + # Try to extract the isRemote setting from the config file + if command -v grep &> /dev/null; then + IS_REMOTE=$(grep -o '"isRemote":[^,}]*' "$EXISTING_CONFIG_PATH" | grep -o 'true\|false') + if [ "$IS_REMOTE" = "true" ]; then + export TRANSMISSION_REMOTE=true + log "INFO" "Detected remote Transmission configuration from existing config" + elif [ "$IS_REMOTE" = "false" ]; then + export TRANSMISSION_REMOTE=false + log "INFO" "Detected local Transmission configuration from existing config" + fi + fi + fi + fi + # Always prompt if we didn't get TRANSMISSION_REMOTE from environment or previous steps if [ -z "$TRANSMISSION_REMOTE" ]; then log "WARN" "TRANSMISSION_REMOTE variable was not set, asking now..." @@ -77,8 +95,8 @@ function install_dependencies() { log "INFO" "Node.js is already installed." fi - # Check if we need to install Transmission (only if local transmission was selected) - if [ "$TRANSMISSION_REMOTE" = false ]; then + # Check if we need to install Transmission (only if local transmission was selected and not in update mode) + if [ "$TRANSMISSION_REMOTE" = false ] && [ "$IS_UPDATE" != "true" ]; then if ! command_exists transmission-daemon; then log "INFO" "Local Transmission installation selected, but transmission-daemon is not installed." log "INFO" "You selected to use a local Transmission installation during configuration."