Fixed 6.15 netstat analysis

This commit is contained in:
thibault.dewailly 2016-04-22 16:59:52 +02:00
parent 22fcd6ca74
commit 6e366172f8

View File

@ -14,7 +14,8 @@ set -u # One variable unset, it's over
# This function will be called if the script status is on enabled / audit mode
audit () {
info "Checking netport ports opened"
eval 'RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]")'
RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]") || :
RESULT=${RESULT:-}
debug "Result is $RESULT"
if [ -z "$RESULT" ]; then
ok "Nothing listens on 25 port, probably unix socket configured"
@ -31,7 +32,8 @@ audit () {
# This function will be called if the script status is on enabled mode
apply () {
info "Checking netport ports opened"
eval 'RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]")'
RESULT=$(netstat -an | grep LIST | grep ":25[[:space:]]") || :
RESULT=${RESULT:-}
debug "Result is $RESULT"
if [ -z "$RESULT" ]; then
ok "Nothing listens on 25 port, probably unix socket configured"