address review

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-08-30 15:13:08 +02:00
parent cac797114a
commit a56fbb6045
5 changed files with 25 additions and 13 deletions

View file

@ -8,12 +8,13 @@ done
set -x
IPv4_ADDRESS_NC="$(dig nextcloud-aio-nextcloud IN A +short | grep '^[0-9.]\+$' | sort | head -n1)"
sed -i "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|g"
sed -i "s# || { src NC_IPV4_PLACEHOLDER }##g" /conf/haproxy.cfg
HAPROXYFILE="$(sed "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|" /haproxy.cfg)"
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
IPv6_ADDRESS_NC="$(dig nextcloud-aio-nextcloud AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)"
sed -i "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|g"
sed -i "s# || { src NC_IPV6_PLACEHOLDER }##g" /conf/haproxy.cfg
HAPROXYFILE="$(sed "s# || { src NC_IPV6_PLACEHOLDER }##g" /tmp/haproxy.cfg)"
HAPROXYFILE="$(echo "$HAPROXYFILE" | sed "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|")"
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
set +x
haproxy -f /conf/haproxy.cfg -db
haproxy -f /tmp/haproxy.cfg -db