Direct prompt for remote Transmission in main installer
- Move the remote Transmission prompt to main installer before config module is called - Modify config module to use the already-set TRANSMISSION_REMOTE variable - Remove existing logic in config module that was causing issues - Clean up environment variables when invoking installer from bootstrap - Remove emergency fallback since we now handle it in the right order 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d2babeba27
commit
1795373b42
@ -75,7 +75,8 @@ echo
|
|||||||
# Add small delay to ensure user sees this message
|
# Add small delay to ensure user sees this message
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
./main-installer.sh
|
# Force the installer to run with the right environment
|
||||||
|
env -i PATH="$PATH" TERM="$TERM" USER="$USER" HOME="$HOME" SUDO_USER="$SUDO_USER" ./main-installer.sh
|
||||||
|
|
||||||
# Installation complete
|
# Installation complete
|
||||||
echo -e "${GREEN}${BOLD}Bootstrap installation complete!${NC}"
|
echo -e "${GREEN}${BOLD}Bootstrap installation complete!${NC}"
|
||||||
|
@ -133,15 +133,28 @@ if [ "$IS_UPDATE" = true ]; then
|
|||||||
else
|
else
|
||||||
# This is a fresh installation - run all steps
|
# This is a fresh installation - run all steps
|
||||||
|
|
||||||
# Step 1: Gather configuration from user
|
# Step 1: First, let's directly ask about Transmission
|
||||||
log "INFO" "Gathering configuration..."
|
# This is a direct approach that bypasses any potential sourcing issues
|
||||||
# Explicitly run this to ensure it's called before dependencies
|
log "INFO" "Configuring Transmission connection..."
|
||||||
set +e # Temporarily disable exit on error
|
echo -e "${BOLD}Transmission Configuration:${NC}"
|
||||||
if ! gather_configuration; then
|
echo -e "Configure connection to your Transmission client:"
|
||||||
|
echo
|
||||||
|
|
||||||
|
read -p "Is Transmission running on a remote server? (y/n) [n]: " input_remote
|
||||||
|
if [[ $input_remote =~ ^[Yy]$ ]]; then
|
||||||
|
export TRANSMISSION_REMOTE=true
|
||||||
|
log "INFO" "Remote Transmission selected."
|
||||||
|
else
|
||||||
|
export TRANSMISSION_REMOTE=false
|
||||||
|
log "INFO" "Local Transmission selected."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Now gather the rest of the configuration
|
||||||
|
log "INFO" "Gathering remaining configuration..."
|
||||||
|
gather_configuration || {
|
||||||
log "ERROR" "Configuration gathering failed"
|
log "ERROR" "Configuration gathering failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
set -e # Re-enable exit on error
|
|
||||||
|
|
||||||
# Debug: Verify TRANSMISSION_REMOTE is set
|
# Debug: Verify TRANSMISSION_REMOTE is set
|
||||||
log "INFO" "After configuration gathering, TRANSMISSION_REMOTE=$TRANSMISSION_REMOTE"
|
log "INFO" "After configuration gathering, TRANSMISSION_REMOTE=$TRANSMISSION_REMOTE"
|
||||||
|
@ -116,12 +116,11 @@ function gather_configuration() {
|
|||||||
echo -e "Configure connection to your Transmission client:"
|
echo -e "Configure connection to your Transmission client:"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Ask if Transmission is remote
|
# Don't ask about remote again - this is now handled in the main installer
|
||||||
read -p "Is Transmission running on a remote server? (y/n) [n]: " input_remote
|
# Just log the current setting for clarity
|
||||||
if [[ $input_remote =~ ^[Yy]$ ]]; then
|
log "INFO" "Using previously selected Transmission mode: $([ "$TRANSMISSION_REMOTE" = true ] && echo "Remote" || echo "Local")"
|
||||||
TRANSMISSION_REMOTE=true
|
|
||||||
export TRANSMISSION_REMOTE=true
|
|
||||||
|
|
||||||
|
if [ "$TRANSMISSION_REMOTE" = true ]; then
|
||||||
# Get and validate hostname
|
# Get and validate hostname
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Remote Transmission host [localhost]: " input_trans_host
|
read -p "Remote Transmission host [localhost]: " input_trans_host
|
||||||
@ -233,9 +232,7 @@ function gather_configuration() {
|
|||||||
# Set Transmission download dir for configuration
|
# Set Transmission download dir for configuration
|
||||||
TRANSMISSION_DOWNLOAD_DIR=$REMOTE_DOWNLOAD_DIR
|
TRANSMISSION_DOWNLOAD_DIR=$REMOTE_DOWNLOAD_DIR
|
||||||
else
|
else
|
||||||
# Local Transmission selected
|
# Local Transmission selected - this part was already set in main-installer.sh
|
||||||
TRANSMISSION_REMOTE=false
|
|
||||||
export TRANSMISSION_REMOTE=false
|
|
||||||
|
|
||||||
echo -e "${YELLOW}You've selected to use a local Transmission installation.${NC}"
|
echo -e "${YELLOW}You've selected to use a local Transmission installation.${NC}"
|
||||||
|
|
||||||
|
@ -13,23 +13,8 @@ function install_dependencies() {
|
|||||||
|
|
||||||
log "INFO" "Transmission mode: $([ "$TRANSMISSION_REMOTE" = true ] && echo "Remote" || echo "Local")"
|
log "INFO" "Transmission mode: $([ "$TRANSMISSION_REMOTE" = true ] && echo "Remote" || echo "Local")"
|
||||||
|
|
||||||
# Debug: print out whether the gather_configuration was called
|
# Log transmission mode
|
||||||
if [ "$IS_UPDATE" != true ]; then
|
log "INFO" "Proceeding with Transmission mode: $([ "$TRANSMISSION_REMOTE" = true ] && echo "Remote" || echo "Local")"
|
||||||
if [ -z "$CONFIG_GATHERED" ]; then
|
|
||||||
log "ERROR" "Configuration step was skipped! This is a bug."
|
|
||||||
log "INFO" "Please report this issue. Will now manually ask about Transmission location."
|
|
||||||
|
|
||||||
# Emergency fix: Ask about remote installation here
|
|
||||||
read -p "Is Transmission running on a remote server? (y/n) [n]: " input_remote
|
|
||||||
if [[ $input_remote =~ ^[Yy]$ ]]; then
|
|
||||||
export TRANSMISSION_REMOTE=true
|
|
||||||
log "INFO" "Remote Transmission selected."
|
|
||||||
else
|
|
||||||
export TRANSMISSION_REMOTE=false
|
|
||||||
log "INFO" "Local Transmission selected."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for package manager
|
# Check for package manager
|
||||||
if command -v apt-get &> /dev/null; then
|
if command -v apt-get &> /dev/null; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user