Browse Source

Merge "Fix netcat option in udp_check.sh for CentOS/RHEL" into stable/ussuri

stable/ussuri
Zuul 5 days ago
committed by Gerrit Code Review
parent
commit
af902186c0
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      octavia/amphorae/backends/utils/udp_check.sh

+ 13
- 1
octavia/amphorae/backends/utils/udp_check.sh View File

@@ -1,4 +1,16 @@
#!/bin/bash

nc_cmd=`which nc`
$nc_cmd -uzv -w1 $1 $2 > /dev/null

nc_flavor=$($nc_cmd --version 2>&1 | grep -o nmap)
case "$nc_flavor" in
nmap)
nc_flavor_opts="-i1"
;;
*) # default, probably openbsd
nc_flavor_opts="-w1"
;;
esac

$nc_cmd -uzv $nc_flavor_opts $1 $2 > /dev/null
exit $?

Loading…
Cancel
Save