Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-01-01 23:34:40 +03:00
parent e62dea61e7
commit 68204a8140

View File

@ -66,6 +66,7 @@ declare -A HANDLERS
HANDLERS[tcp]=check-port
HANDLERS[udp]=check-port
# XXX this seems to be broken...
check-port(){
local udp=
if [[ "${1:0:3}" == "udp" ]] ; then
@ -81,7 +82,7 @@ check-port(){
local res=$(timeout $TIMEOUT nc -vz${udp} $target $port 2>&1)
if [[ "$res" =~ .*open$ ]] ; then
if [[ $res =~ .*open$ ]] ; then
echo ERROR
else
echo OK