From 28b31b95c801b3e1d3a1986b7135608921804d4d Mon Sep 17 00:00:00 2001 From: mboelen Date: Tue, 4 Nov 2014 00:30:08 +0100 Subject: [PATCH] Add OpenBSD support to gather UDP/TCP ports which listen on network --- include/tests_networking | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/tests_networking b/include/tests_networking index 6cd43c58..cd917c51 100644 --- a/include/tests_networking +++ b/include/tests_networking @@ -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"