Add idempotency check for Debian 13 certbot fix

Only apply certbot-dns-multi fix if not already installed.
Checks pip list for certbot-dns-multi before installing golang deps.

Prevents unnecessary reinstallation on repeated update runs.
This commit is contained in:
CanbiZ
2026-01-05 15:00:25 +01:00
parent b42f9fabe1
commit e44a8e8af8
2 changed files with 18 additions and 14 deletions

View File

@@ -180,13 +180,15 @@ EOF
# Fix for Debian 13 Trixie - certbot-dns-multi needed to prevent "API isn't healthy" error
if [[ $(grep -E '^VERSION_ID=' /etc/os-release) == *"13"* ]]; then
msg_info "Applying Debian 13 Certbot Fix"
$STD apt-get install -y golang build-essential git
$STD /opt/certbot/bin/pip install --no-cache-dir setuptools-golang==2.9.0
export CGO_ENABLED=1
export GO111MODULE=on
$STD /opt/certbot/bin/pip install --no-build-isolation --no-cache-dir certbot-dns-multi
msg_ok "Applied Debian 13 Certbot Fix"
if ! /opt/certbot/bin/pip list 2>/dev/null | grep -q certbot-dns-multi; then
msg_info "Applying Debian 13 Certbot Fix"
$STD apt-get install -y golang build-essential git
$STD /opt/certbot/bin/pip install --no-cache-dir setuptools-golang==2.9.0
export CGO_ENABLED=1
export GO111MODULE=on
$STD /opt/certbot/bin/pip install --no-build-isolation --no-cache-dir certbot-dns-multi
msg_ok "Applied Debian 13 Certbot Fix"
fi
fi
fi
msg_ok "Updated Certbot"

View File

@@ -39,13 +39,15 @@ $STD /opt/certbot/bin/pip install certbot certbot-dns-cloudflare
# Fix for Debian 13 Trixie - certbot-dns-multi needed to prevent "API isn't healthy" error
if [[ $(grep -E '^VERSION_ID=' /etc/os-release) == *"13"* ]]; then
msg_info "Applying Debian 13 Certbot Fix"
$STD apt-get install -y golang build-essential git
$STD /opt/certbot/bin/pip install --no-cache-dir setuptools-golang==2.9.0
export CGO_ENABLED=1
export GO111MODULE=on
$STD /opt/certbot/bin/pip install --no-build-isolation --no-cache-dir certbot-dns-multi
msg_ok "Applied Debian 13 Certbot Fix"
if ! /opt/certbot/bin/pip list 2>/dev/null | grep -q certbot-dns-multi; then
msg_info "Applying Debian 13 Certbot Fix"
$STD apt-get install -y golang build-essential git
$STD /opt/certbot/bin/pip install --no-cache-dir setuptools-golang==2.9.0
export CGO_ENABLED=1
export GO111MODULE=on
$STD /opt/certbot/bin/pip install --no-build-isolation --no-cache-dir certbot-dns-multi
msg_ok "Applied Debian 13 Certbot Fix"
fi
fi
ln -sf /opt/certbot/bin/certbot /usr/local/bin/certbot