mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
interfaces.lib.inc, extend ifconfig parsing in legacy_interfaces_details(), for https://github.com/opnsense/core/issues/1662
This commit is contained in:
parent
d86dcd438d
commit
de5ff59ff3
@ -273,8 +273,26 @@ function legacy_interfaces_details($intf = null)
|
||||
return $a['link-local'] - $b['link-local'];
|
||||
});
|
||||
}
|
||||
} elseif (preg_match("/media: (.*)/", $line, $matches)) {
|
||||
// media, when link is between parenthesis grep only the link part
|
||||
$result[$current_interface]['media'] = $matches[1];
|
||||
if (preg_match("/media: .*? \((.*?)\)/", $line, $matches)) {
|
||||
$result[$current_interface]['media'] = $matches[1];
|
||||
}
|
||||
} elseif (preg_match("/status: (.*)$/", $line, $matches)) {
|
||||
$result[$current_interface]['status'] = $matches[1];
|
||||
} elseif (preg_match("/channel (\S*)/", $line, $matches)) {
|
||||
$result[$current_interface]['channel'] = $matches[1];
|
||||
} elseif (preg_match("/ssid (\".*?\"|\S*)/", $line, $matches)) {
|
||||
$result[$current_interface]['ssid'] = $matches[1];
|
||||
} elseif (preg_match("/laggproto (.*)$/", $line, $matches)) {
|
||||
$result[$current_interface]['laggproto'] = $matches[1];
|
||||
} elseif (preg_match("/laggport: (.*)$/", $line, $matches)) {
|
||||
if (empty($result[$current_interface]['laggport'])) {
|
||||
$result[$current_interface]['laggport'] = array();
|
||||
}
|
||||
$result[$current_interface]['laggport'][] = $matches[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user