X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fifup;h=b8536af55959af9953e55f6662a8e0e9fff06881;hb=6692a4555d8b1918484db9dc5561453e5ce1b6c5;hp=5d6fc21ed944b02ddf6ead4236f70edb79252527;hpb=6066bc28dc8b40335ea2a4554691900fa6813c8a;p=rc-scripts.git diff --git a/lib/ifup b/lib/ifup index 5d6fc21..b8536af 100755 --- a/lib/ifup +++ b/lib/ifup @@ -125,11 +125,13 @@ if [ -n "$ETHTOOL_OPTS" ] ; then fi if is_yes "$SLAVE" && [ -n "$MASTER" ] ; then - if ! grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null; then - nls "Enslaving %s to %s" "$DEVICE" "$MASTER" - ip link set dev ${DEVICE} down - echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null - fi + # create master if it doesn't exist yet + [ ! -d "/sys/class/net/${MASTER}" ] && ip link add "${MASTER}" type bond + + nls "Enslaving %s to %s" "${DEVICE}" "${MASTER}" + ip link set "${DEVICE}" master "${MASTER}" + ip link set "${DEVICE}" up + exit 0 fi