Fix Transmission remote configuration handling
This commit addresses an issue where the Transmission remote setting wasn't properly preserved between install scripts. Major changes: - Fixed environment variable sharing between install-script.sh and main-installer.sh - Added multiple methods to locate and load the .env.install file - Removed duplicate log message in dependencies-module.sh - Improved permission handling for the environment file - Directly export TRANSMISSION_REMOTE variable before launching main-installer.sh This ensures the user's choice of remote or local Transmission is correctly honored throughout the installation process. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,21 @@
|
||||
function install_dependencies() {
|
||||
log "INFO" "Installing dependencies..."
|
||||
|
||||
# Make sure TRANSMISSION_REMOTE variable is set
|
||||
# Make sure TRANSMISSION_REMOTE variable is set and honored
|
||||
# First check for environment variable that might have been directly set
|
||||
# Then check the .env.install file in various locations
|
||||
|
||||
# Try relative path first
|
||||
ENV_FILE="$(dirname "$(dirname "$0")")/.env.install"
|
||||
if [ -f "$ENV_FILE" ]; then
|
||||
source "$ENV_FILE"
|
||||
log "INFO" "Loaded transmission settings from environment file: TRANSMISSION_REMOTE=$TRANSMISSION_REMOTE"
|
||||
# Try absolute path as fallback
|
||||
elif [ -f "/opt/develop/transmission-rss-manager/.env.install" ]; then
|
||||
source "/opt/develop/transmission-rss-manager/.env.install"
|
||||
log "INFO" "Loaded transmission settings from absolute path: TRANSMISSION_REMOTE=$TRANSMISSION_REMOTE"
|
||||
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..."
|
||||
@@ -31,9 +45,6 @@ function install_dependencies() {
|
||||
fi
|
||||
|
||||
log "INFO" "Proceeding with Transmission mode: $([ "$TRANSMISSION_REMOTE" = true ] && echo "Remote" || echo "Local")"
|
||||
|
||||
# Log transmission mode
|
||||
log "INFO" "Proceeding with Transmission mode: $([ "$TRANSMISSION_REMOTE" = true ] && echo "Remote" || echo "Local")"
|
||||
|
||||
# Check for package manager
|
||||
if command -v apt-get &> /dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user