From b112a3317cbedc73a6e17b3f711fec84f0d41d4e Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 28 Jan 2014 14:34:15 +1100 Subject: ctdb/tests/eventscripts: Avoid errors on broken pipe ctdb_get_my_public_addresses() attempts to echo things and this causes an error if head has taken the first line and the pipe is closed. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Fri Jan 31 05:30:38 CET 2014 on sn-devel-104 --- ctdb/tests/eventscripts/scripts/local.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ctdb/tests/eventscripts/scripts') diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index e8bf3c4805..85894a41b8 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -396,7 +396,7 @@ ctdb_get_my_public_addresses () # This is suitable for passing to takeip/releaseip ctdb_get_1_public_address () { - ctdb_get_my_public_addresses | head -n 1 + ctdb_get_my_public_addresses | { head -n 1 ; cat >/dev/null ; } } ctdb_not_implemented () @@ -445,7 +445,7 @@ create_policy_routing_config () if [ "$_num_ips" = "all" ] ; then cat else - head -n "$_num_ips" + { head -n "$_num_ips" ; cat >/dev/null ; } fi | while read _dev _ip _bits ; do _net=$(ipv4_host_addr_to_net "$_ip" "$_bits") @@ -474,7 +474,7 @@ check_routes () if [ "$_num_ips" = "all" ] ; then cat else - head -n "$_num_ips" + { head -n "$_num_ips" ; cat >/dev/null ; } fi | { while read _dev _ip _bits ; do _net=$(ipv4_host_addr_to_net "$_ip" "$_bits") -- cgit