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
(Imported from commit
b112a3317cbedc73a6e17b3f711fec84f0d41d4e)
# 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 ()
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")
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")