#!/sbin/runscript depend() { use modules } start() { for b in ${bridge} do ebegin "Create Bridge ${b}" /sbin/brctl addbr ${b} || { retval=$? eend ${retval} "Failed to create bridge ${b}" continue } for i in $(eval echo \$\{bridge_${b}_devices\}) do /sbin/brctl addif ${b} ${i} || { retval=$? eend ${retval} "Failed to add interface ${i}" continue } ifconfig ${i} 0.0.0.0 promisc || \ eend $? "Failed to set up interface ${i}" done done } stop() { for b in ${bridge} do ebegin "Destroy Bridge ${b}" for i in $(eval echo \$\{bridge_${b}_devices\}) do ifconfig ${i} down || \ eend $? "Failed to set down interface ${i}" /sbin/brctl delif ${b} ${i} || { retval=$? eend ${retval} "Failed to del interface ${i}" return ${retval} } done /sbin/brctl delbr ${b} || \ eend ${retval} "Failed to destroy bridge ${b}" done eend $? "Failed to stop bridge" }