From 98f798b9fb949537820e22256a6abc2d2a138e5e Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 3 Dec 2020 17:26:16 +0100 Subject: [PATCH] cerbot: parse HAProxy config file only if HAProxy is found --- CHANGELOG.md | 2 ++ certbot/files/hooks/haproxy.sh | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e409b444..08b8b5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ The **patch** part changes incrementally at each release. ### Fixed +* cerbot: parse HAProxy config file only if HAProxy is found + ### Removed ### Security diff --git a/certbot/files/hooks/haproxy.sh b/certbot/files/hooks/haproxy.sh index 1a7f5d4e..932a3e90 100644 --- a/certbot/files/hooks/haproxy.sh +++ b/certbot/files/hooks/haproxy.sh @@ -56,6 +56,9 @@ main() { fi if daemon_found_and_running; then + readonly haproxy_config_file="/etc/haproxy/haproxy.cfg" + readonly haproxy_cert_dir=$(detect_haproxy_cert_dir) + if found_renewed_lineage; then haproxy_cert_file="${haproxy_cert_dir}/$(basename "${RENEWED_LINEAGE}").pem" failed_cert_file="/root/$(basename "${RENEWED_LINEAGE}").failed.pem" @@ -86,7 +89,5 @@ readonly VERBOSE=${VERBOSE:-"0"} readonly QUIET=${QUIET:-"0"} readonly haproxy_bin=$(command -v haproxy) -readonly haproxy_config_file="/etc/haproxy/haproxy.cfg" -readonly haproxy_cert_dir=$(detect_haproxy_cert_dir) main