2.17: netstat non-numeric output may not interpreted correctly

The port may be aliased in /etc/services
Fixes #224 - no. 1

Signed-off-by: Andreas Stieger <astieger@suse.com>
This commit is contained in:
Andreas Stieger 2017-02-24 10:08:25 +01:00
parent c92e8a142e
commit c15dc6c568

View file

@ -161,7 +161,7 @@ fi
# 2.17
check_2_17="2.17 - Bind swarm services to a specific host interface"
if docker info 2>/dev/null | grep -e "Swarm:*\sactive\s*" >/dev/null 2>&1; then
netstat -lt | grep -e '\[::]:2377' -e '*:2377' -e '0.0.0.0:2377' >/dev/null 2>&1
netstat -lnt | grep -e '\[::]:2377' -e '*:2377' -e '0.0.0.0:2377' >/dev/null 2>&1
if [ $? -eq 1 ]; then
pass "$check_2_17"
else