summaryrefslogtreecommitdiff
path: root/ctdb/tools/ctdb_natgw
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-04-18 15:44:15 +1000
committerAmitay Isaacs <amitay@samba.org>2016-04-25 07:10:14 +0200
commit3f3c483196178e36667236c5e665d9b90f6c81cc (patch)
tree26ac4ab80c94db8c63b855d15936b488362ad1b8 /ctdb/tools/ctdb_natgw
parentfadc67cc45b32ccf4ff9608498d9e067432b45cd (diff)
downloadsamba-3f3c483196178e36667236c5e665d9b90f6c81cc.tar.gz
ctdb-scripts: Drop node count from "ctdb natgw status" output
Tweak "ctdb natgw natgwlist" to keep output format the same. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tools/ctdb_natgw')
-rwxr-xr-xctdb/tools/ctdb_natgw16
1 files changed, 8 insertions, 8 deletions
diff --git a/ctdb/tools/ctdb_natgw b/ctdb/tools/ctdb_natgw
index 5c05886fedb..2ed168df8a5 100755
--- a/ctdb/tools/ctdb_natgw
+++ b/ctdb/tools/ctdb_natgw
@@ -166,10 +166,7 @@ $natgw_nodes
EOF
# Print status of nodes in $_ns, along with node count
- awk -v ns="$_ns" \
- 'BEGIN { out = "" ; count = 0 } \
- ns ~ "@" $2 "@" { out = out "\n" $0 ; count += 1 } \
- END { print "Number of nodes:" count out }' <<EOF
+ awk -v ns="$_ns" 'ns ~ "@" $2 "@" { print $0 }' <<EOF
$nodestatus
EOF
}
@@ -177,14 +174,17 @@ EOF
# For backward compatibility
natgwlist ()
{
- ret=0
+ _ret=0
find_master
if [ $? -eq 2 ] ; then
echo "-1 0.0.0.0"
- ret=2
+ _ret=2
fi
- nodes_status || return $?
- return $ret
+ _t=$(nodes_status) || return $?
+ _n=$(echo "$_t" | wc -l)
+ echo "Number of nodes:${_n}"
+ echo "$_t"
+ return $_ret
}
prog=$(basename "$0")