use netstat to check first and only fall back to netcat if netstat is unavailable
authorroot <root@test1n1.VSOFS1.COM>
Thu, 5 Feb 2009 03:44:46 +0000 (14:44 +1100)
committerroot <root@test1n1.VSOFS1.COM>
Thu, 5 Feb 2009 03:44:46 +0000 (14:44 +1100)
config/functions

index ee48dd256e1b17fc11a2a5ec99b26c715b9de2f0..1073055f9bbf48cd25c0231f2ed96d464a46d116 100644 (file)
@@ -209,7 +209,11 @@ ctdb_check_tcp_ports() {
   # check availability of netcat or netstat first
   NETCAT=""
   NETSTAT=""
-  if [ -x /usr/bin/netcat ]; then
+  if [ -x /usr/bin/netstat ]; then
+      NETSTAT=/usr/bin/netstat
+  elif [ -x /bin/netstat ]; then
+      NETSTAT=/bin/netstat
+  elif [ -x /usr/bin/netcat ]; then
       NETCAT=/usr/bin/netcat
   elif [ -x /bin/netcat ]; then
       NETCAT=/bin/netcat
@@ -217,10 +221,6 @@ ctdb_check_tcp_ports() {
       NETCAT=/usr/bin/nc
   elif [ -x /bin/nc ]; then
       NETCAT=/bin/nc
-  elif [ -x /usr/bin/netstat ]; then
-      NETSTAT=/usr/bin/netstat
-  elif [ -x /bin/netstat ]; then
-      NETSTAT=/bin/netstat
   fi
 
   for p in $wait_ports; do