diff options
Diffstat (limited to 'cron-sh/scripts/02_network.sh')
-rwxr-xr-x | cron-sh/scripts/02_network.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cron-sh/scripts/02_network.sh b/cron-sh/scripts/02_network.sh index b52f914..c81358f 100755 --- a/cron-sh/scripts/02_network.sh +++ b/cron-sh/scripts/02_network.sh @@ -25,7 +25,12 @@ if [[ -f ${FIREWALL_TODAY} ]]; then fi if [[ ${CHECK_OPEN_PORT} == yes ]]; then - netstat -pvlA inet,inet6 2> /dev/null > ${OPEN_PORT_TODAY}; + if [[ ${IGNORE_PID_CHANGES} = yes ]]; then + FILTER="sed -e s/\(PID\|[0-9]*\)\/\(.*\)$/\2/g" + else + FILTER="cat" + fi + netstat -pvlA inet,inet6 2> /dev/null | $FILTER > ${OPEN_PORT_TODAY}; Filter ${OPEN_PORT_TODAY} CHECK_OPEN_PORT Count ${INFOS} ${OPEN_PORT_TODAY} "Total of open network ports" fi |