From 784956796d301baf4060587b0403056f43273690 Mon Sep 17 00:00:00 2001 From: SamNet-dev Date: Fri, 13 Feb 2026 00:29:32 -0600 Subject: [PATCH] fix: wait for dpkg lock and fix menu not opening via curl pipe install_package() now waits up to 60s for unattended-upgrades to release the dpkg lock instead of failing immediately. Also redirect stdin from /dev/tty when exec'ing the menu so the terminal check passes when the installer was invoked via curl | bash. --- conduit.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/conduit.sh b/conduit.sh index 252ae9b..bf4c17b 100644 --- a/conduit.sh +++ b/conduit.sh @@ -162,6 +162,19 @@ install_package() { case "$PKG_MANAGER" in apt) + # Wait for dpkg lock if held by another process (e.g. unattended-upgrades) + local _apt_tries=0 + while fuser /var/lib/dpkg/lock-frontend &>/dev/null 2>&1; do + if [ $_apt_tries -eq 0 ]; then + log_warn "Waiting for dpkg lock (held by another process)..." + fi + _apt_tries=$((_apt_tries + 1)) + if [ $_apt_tries -ge 30 ]; then + log_error "dpkg lock held for too long, skipping $package" + return 1 + fi + sleep 2 + done apt-get update -q || log_warn "apt-get update failed, attempting install anyway..." if apt-get install -y -q "$package"; then log_success "$package installed successfully" @@ -15153,7 +15166,7 @@ SVCEOF systemctl restart conduit-telegram 2>/dev/null || true fi fi - exec "$INSTALL_DIR/conduit" menu + exec "$INSTALL_DIR/conduit" menu < /dev/tty ;; 2) echo ""