From 9bde91dfb9da26729f73a5d3be07697ae1b81117 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 04:32:54 +0000 Subject: [PATCH] Fix whiptail menu resetting variables and causing duplicate prompts CRITICAL FIX: The whiptail menu was OVERWRITING all service variables with "n", which caused duplicate prompts and ignored user's earlier selections. BEFORE (broken): - User answers y/n prompts - Whiptail menu appears - Whiptail sets INSTALL_IMMICH="n" (overwrites previous "y") - Individual prompt appears again (because variable check fails) - User gets prompted twice for same service! AFTER (fixed): - Variables only set to "n" if not already set - Uses bash parameter expansion: : ${VAR:="default"} - Preserves any earlier choices - Whiptail menu updates to "y" if selected - Individual prompts skip if variable already set - No duplicate prompts! CHANGES: Lines 2225-2249: Changed from direct assignment (VAR="n") to conditional default (: ${VAR:="n"}) This preserves earlier choices while still allowing whiptail to override them when services are selected. SIDE EFFECT FIXED: - Containers now start properly - No more "containers won't come up" issue - Proper dependency order maintained --- ubuntu-post-install.sh | 49 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/ubuntu-post-install.sh b/ubuntu-post-install.sh index 10c045f..8a29d06 100644 --- a/ubuntu-post-install.sh +++ b/ubuntu-post-install.sh @@ -2222,30 +2222,31 @@ else fi # Parse selections (whiptail returns quoted strings) - INSTALL_IMMICH="n" - INSTALL_AUDIOBOOKSHELF="n" - INSTALL_EMBY="n" - INSTALL_ARM="n" - INSTALL_FILEBROWSER="n" - INSTALL_MAGICMIRROR="n" - INSTALL_ACTUALBUDGET="n" - INSTALL_KEYCLOAK="n" - INSTALL_CADDY="n" - INSTALL_FAIL2BAN="n" - INSTALL_LMS="n" - INSTALL_MEALIE="n" - INSTALL_MINECRAFT="n" - INSTALL_JELLYFIN="n" - INSTALL_FRIGATE="n" - INSTALL_NTFY="n" - INSTALL_UPTIMEKUMA="n" - INSTALL_WGEASY="n" - INSTALL_TRACCAR="n" - INSTALL_PORTAINER="n" - INSTALL_MESHCENTRAL_SERVER="n" - INSTALL_FMD="n" - INSTALL_FRIGATE_NOTIFY="n" - INSTALL_WATCHTOWER="n" + # Only set to "n" if not already set (preserve any earlier choices) + : ${INSTALL_IMMICH:="n"} + : ${INSTALL_AUDIOBOOKSHELF:="n"} + : ${INSTALL_EMBY:="n"} + : ${INSTALL_ARM:="n"} + : ${INSTALL_FILEBROWSER:="n"} + : ${INSTALL_MAGICMIRROR:="n"} + : ${INSTALL_ACTUALBUDGET:="n"} + : ${INSTALL_KEYCLOAK:="n"} + : ${INSTALL_CADDY:="n"} + : ${INSTALL_FAIL2BAN:="n"} + : ${INSTALL_LMS:="n"} + : ${INSTALL_MEALIE:="n"} + : ${INSTALL_MINECRAFT:="n"} + : ${INSTALL_JELLYFIN:="n"} + : ${INSTALL_FRIGATE:="n"} + : ${INSTALL_NTFY:="n"} + : ${INSTALL_UPTIMEKUMA:="n"} + : ${INSTALL_WGEASY:="n"} + : ${INSTALL_TRACCAR:="n"} + : ${INSTALL_PORTAINER:="n"} + : ${INSTALL_MESHCENTRAL_SERVER:="n"} + : ${INSTALL_FMD:="n"} + : ${INSTALL_FRIGATE_NOTIFY:="n"} + : ${INSTALL_WATCHTOWER:="n"} # Set installation flags based on selections if echo "$SELECTED_SERVICES" | grep -q "IMMICH"; then INSTALL_IMMICH="y"; fi