mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18: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:
parent
0a376b23db
commit
530e8d4b9e
ctdb/config
@ -25,7 +25,8 @@ fi
|
|||||||
get_all_interfaces ()
|
get_all_interfaces ()
|
||||||
{
|
{
|
||||||
# Get all the interfaces listed in the public_addresses file
|
# 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/,/ /g' \
|
||||||
-e 's/[\t ]*$//' "$ctdb_public_addresses")
|
-e 's/[\t ]*$//' "$ctdb_public_addresses")
|
||||||
|
|
||||||
|
@ -611,6 +611,9 @@ drop_all_public_ips ()
|
|||||||
# _x is intentionally ignored
|
# _x is intentionally ignored
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
while read _ip _x ; do
|
while read _ip _x ; do
|
||||||
|
case "$_ip" in
|
||||||
|
\#*) continue ;;
|
||||||
|
esac
|
||||||
drop_ip "$_ip"
|
drop_ip "$_ip"
|
||||||
done <"${CTDB_BASE}/public_addresses"
|
done <"${CTDB_BASE}/public_addresses"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user