1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

ctdb_check_tcp_ports: fail the check if neither netstat nor netcat/nc is found

Michael

(This used to be ctdb commit 25d04bbe9528fafc68751f7beb22daeee3163d34)
This commit is contained in:
Michael Adam 2009-01-30 16:41:37 +01:00
parent ba6612ec12
commit bbf36eebb9

View File

@ -230,6 +230,10 @@ ctdb_check_tcp_ports() {
${NETCAT} -z 127.0.0.1 $p > /dev/null || all_ok=0
elif [ "x${NETSTAT}" != "x" ]; then
( ${NETSTAT} -a -n | egrep "0.0.0.0:$p .*LISTEN" > /dev/null ) || all_ok=0
else
echo "ERROR: neither netcat (or nc) nor netstat found!"
echo "ERROR: can't monitor ${service_name} tcp port ${p}"
all_ok=0
fi
[ $all_ok -eq 1 ] || {