Skip to content

Commit

Permalink
talk: automatically bind ipv4 only if ipv6 is disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Jan 22, 2025
1 parent d1b37c1 commit 895f4b8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Containers/talk/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 895f4b8

Please sign in to comment.