mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 18:14:42 +00:00
Merge pull request #1135 from pv2b/fix-missing-dmesg
(get_interface_list) Properly handle an interface not appearing in dmesg
This commit is contained in:
commit
c77dd450ac
@ -948,12 +948,13 @@ function get_interface_list($only_active = false)
|
||||
}
|
||||
|
||||
$dmesg_arr = array();
|
||||
$toput['dmesg'] = null;
|
||||
exec("/sbin/dmesg |grep $ifname", $dmesg_arr);
|
||||
preg_match_all("/<(.*?)>/i", $dmesg_arr[0], $dmesg);
|
||||
if (isset($dmesg[1][0])) {
|
||||
$toput['dmesg'] = $dmesg[1][0];
|
||||
} else {
|
||||
$toput['dmesg'] = null;
|
||||
if (count($dmesg_arr) > 0) {
|
||||
preg_match_all("/<(.*?)>/i", $dmesg_arr[0], $dmesg);
|
||||
if (isset($dmesg[1][0])) {
|
||||
$toput['dmesg'] = $dmesg[1][0];
|
||||
}
|
||||
}
|
||||
|
||||
$iflist[$ifname] = $toput;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user