--- bonding.sh 2012-06-18 13:35:01.000000000 +0200 +++ bonding.sh.new 2012-06-18 13:45:01.000000000 +0200 @@ -61,12 +61,23 @@ eerror "Failed to configure $n (${n}_${IFVAR})" fi done + # Configure link monitoring + for x in /sys/class/net/"${IFACE}"/bonding/miimon; do + [ -f "${x}" ] || continue + n=${x##*/} + eval s=\$${n}_${IFVAR} + if [ -n "${s}" ]; then + einfo "Setting ${n}: ${s}" + echo "${s}" >"${x}" || \ + eerror "Failed to configure $n (${n}_${IFVAR})" + fi + done # Nice and dynamic for remaining options:) for x in /sys/class/net/"${IFACE}"/bonding/*; do [ -f "${x}" ] || continue n=${x##*/} eval s=\$${n}_${IFVAR} - [ "${n}" != "mode" ] || continue + [ "${n}" != "mode" -o "${n}" != "miimon" ] || continue if [ -n "${s}" ]; then einfo "Setting ${n}: ${s}" echo "${s}" >"${x}" || \