Note that order of sed expressions matters: the expression to delete
comment lines must come first as the second expression would transform
# comment
to
comment
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14826
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
get_all_interfaces ()
{
# Get all the interfaces listed in the public_addresses file
- all_interfaces=$(sed -e 's/^[^\t ]*[\t ]*//' \
+ all_interfaces=$(sed -e '/^#.*/d' \
+ -e 's/^[^\t ]*[\t ]*//' \
-e 's/,/ /g' \
-e 's/[\t ]*$//' "$ctdb_public_addresses")
# _x is intentionally ignored
# shellcheck disable=SC2034
while read _ip _x ; do
+ case "$_ip" in
+ \#*) continue ;;
+ esac
drop_ip "$_ip"
done <"${CTDB_BASE}/public_addresses"
}