Detect IPv6 in udp_proxy_wrapper.sh grepping for server_addr=::1

This commit is contained in:
Hanno Becker 2017-10-23 15:29:31 +01:00
parent 22829e9860
commit a677cdd459

View File

@ -35,8 +35,10 @@ cleanup() {
trap cleanup INT TERM HUP
DTLS_ENABLED=$(echo "$SERVER_PARAMS" | grep -v "::1" | grep "dtls=1")
if [ -z "$DTLS_ENABLED" ]; then
DTLS_ENABLED=$(echo " $SERVER_PARAMS" | grep " dtls=1")
IPV6_IN_USE=$(echo " $SERVER_PARAMS" | grep " server_addr=::1" )
if [ -z "$DTLS_ENABLED" ] || [ -n "$IPV6_IN_USE" ]; then
echo " * Couldn't find DTLS enabling, or IPv6 is in use - immediate fallback to server application..."
if [ $VERBOSE -gt 0 ]; then
echo "[ $SRV_BIN $SERVER_PARAMS ]"