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
This commit is contained in:
+25
-24
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user