aboutsummaryrefslogtreecommitdiff
path: root/docker/haproxy/ensure_latest_config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/haproxy/ensure_latest_config.sh')
-rwxr-xr-xdocker/haproxy/ensure_latest_config.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/docker/haproxy/ensure_latest_config.sh b/docker/haproxy/ensure_latest_config.sh
new file mode 100755
index 000000000..b91189ca5
--- /dev/null
+++ b/docker/haproxy/ensure_latest_config.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+CURRENT_CONFIG_HASH=$(sha1sum /etc/haproxy/haproxy.cfg | cut -f1 -d' ')
+NEW_CONFIG_HASH=$(sha1sum /opt/kolla/haproxy/haproxy.cfg | cut -f1 -d' ')
+
+if [[ $CURRENT_CONFIG_HASH != $NEW_CONFIG_HASH ]]; then
+ changed=changed
+ source /opt/kolla/config-external.sh
+ /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -sf $(cat /run/haproxy.pid)
+fi
+
+echo $changed