Allow configuration of bond via extra sysfs entries, #105.

This commit is contained in:
Roy Marples
2008-09-19 09:32:24 +00:00
parent 2de401bca1
commit 600d1f62fb
2 changed files with 16 additions and 1 deletions

View File

@ -15,7 +15,7 @@ _is_bond()
bonding_pre_start()
{
local s= slaves="$(_get_array "slaves_${IFVAR}")"
local x= s= slaves="$(_get_array "slaves_${IFVAR}")"
[ -z "${slaves}" ] && return 0
@ -39,6 +39,16 @@ bonding_pre_start()
return 1
fi
# Configure the bond.
# Nice and dynamic :)
for x in /sys/class/net/"${IFACE}"/bonding/*; do
[ -f "${x}" ] || continue
eval s=\$${x##*/}_${IFVAR}
if [ -n "${s}" ]; then
echo "${s}" >"${x}"
fi
done
ebegin "Adding slaves to ${IFACE}"
eindent
einfo "${slaves}"