From 895f4b82e3fcb112821afa2b7938327b467ef0d4 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Wed, 22 Jan 2025 16:51:55 +0100 Subject: [PATCH] talk: automatically bind ipv4 only if ipv6 is disabled Signed-off-by: Simon L. --- Containers/talk/start.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index e73525b8d11..c382f7f1316 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -30,14 +30,21 @@ if [ -n "$IPv4_ADDRESS_TALK" ] && [ "$IPv4_ADDRESS_TALK_RELAY" = "$IPv4_ADDRESS_ IPv4_ADDRESS_TALK="" fi +IP_BINDING="::" +if grep -q "1" /sys/module/ipv6/parameters/disable \ +|| sysctl -a 2>/dev/null | grep "net.ipv6.conf.all.disable_ipv6" | grep -q "1" \ +|| sysctl -a 2>/dev/null | grep "net.ipv6.conf.default.disable_ipv6" | grep -q "1"; then + IP_BINDING="0.0.0.0" +fi + # Turn cat << TURN_CONF > "/conf/eturnal.yml" eturnal: listen: - - ip: "::" + - ip: "$IP_BINDING" port: $TALK_PORT transport: udp - - ip: "::" + - ip: "$IP_BINDING" port: $TALK_PORT transport: tcp log_dir: stdout