all_ok=1
for p in $wait_ports; do
if [ -x /usr/bin/netcat ]; then
- /usr/bin/netcat -z 127.0.0.1 $p || all_ok=0
+ /usr/bin/netcat -z 127.0.0.1 $p > /dev/null || all_ok=0
elif [ -x /usr/bin/nc ]; then
- /usr/bin/nc -z 127.0.0.1 $p || all_ok=0
+ /usr/bin/nc -z 127.0.0.1 $p > /dev/null || all_ok=0
elif [ -x /usr/bin/netstat ]; then
- (/usr/bin/netstat -a -n | egrep "0.0.0.0:$p .*LISTEN") || all_ok=0
+ (/usr/bin/netstat -a -n | egrep "0.0.0.0:$p\s*LISTEN" > /dev/null) || all_ok=0
else
echo "`date` - No tool to check tcp ports availabe. can not check in ctdb_wait_tcp_ports"
return