mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-11-10 17:03:44 +08:00
fix ipv6 for haproxy
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
e0e26ffc4d
commit
305dba38a2
1 changed files with 5 additions and 3 deletions
|
@ -12,9 +12,11 @@ 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)"
|
||||
HAPROXYFILE="$(sed "s# || { src NC_IPV6_PLACEHOLDER }##g" /tmp/haproxy.cfg)"
|
||||
# shellcheck disable=SC2001
|
||||
HAPROXYFILE="$(echo "$HAPROXYFILE" | sed "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|")"
|
||||
if [ -n "$IPv6_ADDRESS_NC" ]; then
|
||||
HAPROXYFILE="$(sed "s|NC_IPV6_PLACEHOLDER|$IPv6_ADDRESS_NC|" /tmp/haproxy.cfg)"
|
||||
else
|
||||
HAPROXYFILE="$(sed "s# || { src NC_IPV6_PLACEHOLDER }##g" /tmp/haproxy.cfg)"
|
||||
fi
|
||||
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
||||
set +x
|
||||
|
||||
|
|
Loading…
Reference in a new issue