diff options
Diffstat (limited to 'net/bonding.sh')
-rw-r--r-- | net/bonding.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/bonding.sh b/net/bonding.sh index 6d15f0da..15f41e20 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -97,13 +97,15 @@ bonding_pre_start() # finally add in slaves eoutdent if [ -d /sys/class/net ]; then + sys_bonding_path=/sys/class/net/"${IFACE}"/bonding if [ -n "${primary}" ]; then - echo "+${primary}" >/sys/class/net/"${IFACE}"/bonding/slaves - echo "${primary}" >/sys/class/net/"${IFACE}"/bonding/primary + echo "+${primary}" >$sys_bonding_path/slaves + echo "${primary}" >$sys_bonding_path/primary fi for s in ${slaves}; do [ "${s}" = "${primary}" ] && continue - echo "+${s}" >/sys/class/net/"${IFACE}"/bonding/slaves + grep -q ${s} $sys_bonding_path/slaves \ + || echo "+${s}" >$sys_bonding_path/slaves done else /sbin/ifenslave "${IFACE}" ${slaves} >/dev/null |