1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

Eventscripts: 10.interface should list configured interfaces

The current code lists available interfaces.  If IPs are configured in
some other way than the public addresses file (e.g. ctdb addip) and their
interfaces default to being marked down then, since down interfaces are
not available, these interfaces can never be marked up.

The configured interfaces should be listed instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d8f010355b715e49709836e057a5d0f110919897)
This commit is contained in:
Martin Schwenke 2012-11-16 20:21:15 +11:00 committed by Amitay Isaacs
parent 0f1bcebc80
commit 8fad7670f1

View File

@ -41,9 +41,9 @@ get_all_interfaces ()
[ "$CTDB_PUBLIC_INTERFACE" ] && all_interfaces="$CTDB_PUBLIC_INTERFACE $all_interfaces"
[ "$CTDB_NATGW_PUBLIC_IFACE" ] && all_interfaces="$CTDB_NATGW_PUBLIC_IFACE $all_interfaces"
# For all but the 1st line, get the 2nd last field with commas
# changes to spaces.
ctdb_ifaces=$(ctdb -Y ip -v | sed -e '1d' -e 's/:[^:]*:$//' -e 's/^.*://' -e 's/,/ /g')
# Get the configured interfaces for each IP. That is, for all but
# the 1st line, get the last field with commas changed to spaces.
ctdb_ifaces=$(ctdb -Y ip -v | sed -e '1d' -e 's/:$//' -e 's/^.*://' -e 's/,/ /g')
# Add $ctdb_interfaces and uniquify
all_interfaces=$(echo $all_interfaces $ctdb_ifaces | tr ' ' '\n' | sort -u)