fix(nginxproxymanager): repair broken certbot pip before update

Use ensurepip when the certbot venv pip module is missing, then upgrade via python -m pip.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
MickLesk
2026-06-19 22:28:38 +02:00
parent 6710cb5210
commit b4e33b5ab0
+7 -2
View File
@@ -108,8 +108,13 @@ EOF
cd /root
if [ -d /opt/certbot ]; then
msg_info "Updating Certbot"
$STD /opt/certbot/bin/pip install --upgrade pip setuptools wheel
$STD /opt/certbot/bin/pip install --upgrade certbot certbot-dns-cloudflare
CERTBOT_PYTHON="/opt/certbot/bin/python"
if ! "$CERTBOT_PYTHON" -m pip --version &>/dev/null; then
msg_info "Repairing Certbot pip"
$STD "$CERTBOT_PYTHON" -m ensurepip --upgrade
fi
$STD "$CERTBOT_PYTHON" -m pip install --upgrade pip setuptools wheel
$STD "$CERTBOT_PYTHON" -m pip install --upgrade certbot certbot-dns-cloudflare
msg_ok "Updated Certbot"
fi