diff options
author | Martin Schwenke <martin@meltin.net> | 2014-01-28 14:34:15 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-01-31 05:30:37 +0100 |
commit | b112a3317cbedc73a6e17b3f711fec84f0d41d4e (patch) | |
tree | 7de656aaa66ae992b9c63715be0a2595e16ac398 /ctdb | |
parent | 1640f36d5831b2575d117fac335f3324ceefa9f8 (diff) | |
download | samba-b112a3317cbedc73a6e17b3f711fec84f0d41d4e.tar.gz samba-b112a3317cbedc73a6e17b3f711fec84f0d41d4e.tar.xz samba-b112a3317cbedc73a6e17b3f711fec84f0d41d4e.zip |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Jan 31 05:30:38 CET 2014 on sn-devel-104
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/tests/eventscripts/scripts/local.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index e8bf3c48056..85894a41b82 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") |