X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=lib%2Fifup-bond;h=3c1d648098817f452d7b5a455f51a58d32f93df7;hb=refs%2Fheads%2Fmaster;hp=5651839c072d2025d80e39aeb76e7dbfc54ea725;hpb=7469b84d1e7ffde6f48bf19b999c005249df5dae;p=rc-scripts.git diff --git a/lib/ifup-bond b/lib/ifup-bond index 5651839..3c1d648 100755 --- a/lib/ifup-bond +++ b/lib/ifup-bond @@ -35,20 +35,15 @@ fi if [ ! -f /sys/class/net/bonding_masters ]; then modprobe -s bonding || exit 1 # delete default bond0 - echo "-bond0" > /sys/class/net/bonding_masters + ip link del bond0 type bond fi # set all major variables setup_ip_param # create bonding master -if ! grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then - echo "+${DEVICE}" > /sys/class/net/bonding_masters - if [ $? -eq 0 ]; then - ip link set dev ${DEVICE} multicast ${MULTICAST} ${ARP} - else - exit 1 - fi +if [ ! -d "/sys/class/net/${DEVICE}" ]; then + ip link add "${DEVICE}" type bond fi # add the bits to setup driver parameters here