diff options
author | Colin Smith <colin@pfsense.org> | 2005-09-18 19:36:46 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-09-18 19:36:46 +0000 |
commit | 49149b86c3ba1becbf21fb307934c2e82ec89458 (patch) | |
tree | 647e79d669ec255b953d3b85414950f48e4e54f7 /etc | |
parent | 202036466e4ec06fea91b315c51370355243752b (diff) | |
download | pfsense-49149b86c3ba1becbf21fb307934c2e82ec89458.zip pfsense-49149b86c3ba1becbf21fb307934c2e82ec89458.tar.gz |
Trim one preg_grep() call.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/util.inc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 3cd38c2..db3b4a4 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -249,12 +249,11 @@ function get_interface_list($mode = "active", $keyby = "physical") { $intlist = explode(" ", trim(shell_exec("/sbin/ifconfig -l"))); exec("/sbin/ifconfig -a", $ifconfig); $regexp = '/(' . implode('|', $intlist) . '):\s/'; - $ints = preg_grep($regexp, $ifconfig); $ifstatus = preg_grep('/status:/', $ifconfig); - foreach($ints as $value) { - $status = trim(array_shift($ifstatus)); - if(stristr($status, "active")) $upints[] = array_shift($intlist); - } + $i = 0; + foreach($ifstatus as $status) { + if(stristr($status, "active")) $upints[] = array_shift($intlist); + } break; } /* build interface list with netstat */ |