From 131114e4b751f329fccba4954fa8e9c27c85af01 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Tue, 20 Jun 2023 00:12:09 +0200 Subject: [PATCH] feat(haproxy): Add ACME deploy helper script --- haproxy_reload.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 haproxy_reload.sh diff --git a/haproxy_reload.sh b/haproxy_reload.sh new file mode 100755 index 0000000..05c678f --- /dev/null +++ b/haproxy_reload.sh @@ -0,0 +1,8 @@ +#!/bin/bash +declare haproxy_container="${1:?}" +if systemctl --quiet is-active docker.service; then + if [[ "$( docker container inspect -f '{{.State.Running}}' "${haproxy_container}" 2> /dev/null )" == "true" ]]; then + docker exec -t "${haproxy_container}" haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg && \ + docker kill --signal SIGHUP "${haproxy_container}" + fi +fi