From ce33da32e8f9ddbed2ab9c639034ba70805b5058 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 12 Oct 2005 23:45:41 +0000 Subject: Make get_number_of_bridged_interfaces() a little more industrial strength by actually looking at the bridge numbers instead of the quantity of bridges --- etc/inc/interfaces.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a89d1a3..85c8b33 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1282,8 +1282,13 @@ function is_altq_capable($int) { } function get_number_of_bridged_interfaces() { - $bridges = trim(`/sbin/ifconfig -a | /usr/bin/grep bridge | /usr/bin/wc -l`); - return "{$bridges}"; + $bridges_total = 0; + $bridges = split("\n", `/sbin/ifconfig -a | /usr/bin/grep bridge | grep flags`); + foreach($bridges as $bridge) { + preg_match_all("/bridge(.*):/",$bridge,$match_array); + $bridges_total = $match_array[1][0]; + } + return "{$bridges_total}"; } function get_next_available_bridge_interface() { -- cgit v1.1