diff options
-rw-r--r-- | testing/bonding/APKBUILD | 2 | ||||
-rwxr-xr-x | testing/bonding/bonding.pre-up | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/testing/bonding/APKBUILD b/testing/bonding/APKBUILD index 055fc4285..840d8553e 100644 --- a/testing/bonding/APKBUILD +++ b/testing/bonding/APKBUILD @@ -5,7 +5,7 @@ pkgname=bonding pkgver=2.6 -pkgrel=0 +pkgrel=1 pkgdesc="Scripts for network interface bonding" url="http://wiki.alpinelinux.org/wiki/Bonding" arch="noarch" diff --git a/testing/bonding/bonding.pre-up b/testing/bonding/bonding.pre-up index f93fadde8..69f6fbe26 100755 --- a/testing/bonding/bonding.pre-up +++ b/testing/bonding/bonding.pre-up @@ -46,6 +46,15 @@ sysfs_add() done } +ifup_slave() +{ + local v= + [ "$VERBOSITY" = 1 ] && v=-v + if [ "$1" != "$IFACE" ] && ! grep -q "^$1=" $IFSTATE && ifup -n "$1" >/dev/null 2>&1; then + ifup $v $1 + fi +} + enslave_slaves() { case "$BOND_SLAVES" in @@ -58,7 +67,6 @@ enslave_slaves() ;; esac - [ "$VERBOSITY" = 1 ] && v=-v for slave in $BOND_SLAVES ; do if ( [ "$AUTOIF" ] && grep -q "^$slave=" $IFSTATE ) ; then echo "Not enslaving interface $slave since it is already configured" @@ -68,11 +76,9 @@ enslave_slaves() if ! sysfs_add "$slave" slaves 2>/dev/null ; then echo "Failed to enslave $slave to $BOND_MASTER. Is $BOND_MASTER ready and a bonding interface ?" >&2 else - # Bring up slave if it is the target of an allow-bondX stanza. + # Bring up slave if it is defined in interfaces # This is usefull to bring up slaves that need extra setup. - if ifup -n "$slave" >/dev/null 2>&1; then - ifup $v "$slave" - fi + ifup_slave $slave fi fi done |