1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-scripts: filter out comments in public_addresses file

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>
This commit is contained in:
Ralph Boehme 2021-09-08 16:53:12 +02:00 committed by Martin Schwenke
parent 0a376b23db
commit 530e8d4b9e
2 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,8 @@ fi
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")

View File

@ -611,6 +611,9 @@ drop_all_public_ips ()
# _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"
}