diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-08 19:54:36 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-08 19:54:36 +0000 |
commit | d7291212f45a277c186a20eafb4b4b3dda8e3ada (patch) | |
tree | 69c67260b2ad29af2febb4e4c755e406e3f82e44 | |
parent | 0ca801493d28fc0f6a32edfbc5af8edb16987d5d (diff) | |
download | aports-d7291212f45a277c186a20eafb4b4b3dda8e3ada.tar.bz2 aports-d7291212f45a277c186a20eafb4b4b3dda8e3ada.tar.xz |
testing/bonding: fix for brining up the slaves
-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 055fc42855..840d8553ea 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 f93fadde80..69f6fbe261 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 |