Add OpenBSD support to gather UDP/TCP ports which listen on network

This commit is contained in:
mboelen 2014-11-04 00:30:08 +01:00
parent 0a3482b968
commit 28b31b95c8
1 changed files with 10 additions and 0 deletions

View File

@ -310,6 +310,16 @@
fi
FIND2=""
;;
OpenBSD)
if [ ! "${NETSTATBINARY}" = "" ]; then
# UDP
FIND=`${NETSTATBINARY} -an 2> /dev/null | grep "^udp" | awk '{ print $4"|"$1"||" }'`
# TCP
FIND2=`${NETSTATBINARY} -an 2> /dev/null | grep "^tcp" | awk '{ if($6=="LISTEN") { print $4"|"$1"||" }}'`
else
ReportException "${TEST_NO}:3" "netstat missing to gather listening ports"
fi
;;
*)
# Got this exception? Provide your details and output of netstat or any other tool to determine this information.
ReportException "${TEST_NO}:2" "Unclear what method to use, to determine listening port information"