From 2c03220afe0840b9ef8afd663694ba8ae79ffbbe Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Fri, 23 Feb 2024 11:36:16 +0300 Subject: [PATCH] fix padding for `EX_APPS_COUNT` (#16) Signed-off-by: Alexander Piskun --- start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 4951ae7..a2da462 100644 --- a/start.sh +++ b/start.sh @@ -3,8 +3,9 @@ sed -i "s|NC_PASSWORD_PLACEHOLDER|$NC_HAPROXY_PASSWORD|" /haproxy.cfg if [ -f "/certs/cert.pem" ]; then + EX_APPS_COUNT_PADDED=$(printf "%03d" "$EX_APPS_COUNT") sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:$HAPROXY_PORT v4v6 ssl crt /certs/cert.pem|" /haproxy.cfg - sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:23000-23$EX_APPS_COUNT v4v6 ssl crt /certs/cert.pem|" /haproxy_ex_apps.cfg + sed -i "s|BIND_ADDRESS_PLACEHOLDER|bind $BIND_ADDRESS:23000-23$EX_APPS_COUNT_PADDED v4v6 ssl crt /certs/cert.pem|" /haproxy_ex_apps.cfg sed -i "s|EX_APPS_NET_PLACEHOLDER|$EX_APPS_NET|" /haproxy_ex_apps.cfg # Chmod certs to be accessible by haproxy chmod 644 /certs/cert.pem