aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh/scripts
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-03-10 14:35:49 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-03-10 14:35:49 +0000
commit76d4891ca0b06ba368d185f78d24e7d8a5382fd4 (patch)
tree4b3a6e6ff364280a34211e2ba2f3da14c687af3d /cron-sh/scripts
parentea472e0767e030cb39016bfc68cd986079818209 (diff)
downloadmsec-76d4891ca0b06ba368d185f78d24e7d8a5382fd4.tar
msec-76d4891ca0b06ba368d185f78d24e7d8a5382fd4.tar.gz
msec-76d4891ca0b06ba368d185f78d24e7d8a5382fd4.tar.bz2
msec-76d4891ca0b06ba368d185f78d24e7d8a5382fd4.tar.xz
msec-76d4891ca0b06ba368d185f78d24e7d8a5382fd4.zip
Added support for ignoring changes in pid when checking for open ports
(#56744)
Diffstat (limited to 'cron-sh/scripts')
-rwxr-xr-xcron-sh/scripts/02_network.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/cron-sh/scripts/02_network.sh b/cron-sh/scripts/02_network.sh
index f790dee..c50af4c 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_is_enabled "${CHECK_OPEN_PORT}" ; then
- netstat -pvlA inet,inet6 2> /dev/null > ${OPEN_PORT_TODAY};
+ if [[ ${IGNORE_PID_CHANGES} = yes ]]; then
+ FILTER="sed -e s/\([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