mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
(legacy) fix media selection in interfaces.php
This commit is contained in:
parent
cf732b0e2f
commit
c3894df0a6
@ -1323,15 +1323,18 @@ if (isset($a_interfaces[$if]['wireless'])) {
|
||||
|
||||
// Find all possible media options for the interface
|
||||
$mediaopts_list = array();
|
||||
exec("/sbin/ifconfig -m {$pconfig['if']} | grep \"media \"", $mediaopts);
|
||||
foreach ($mediaopts as $mediaopt){
|
||||
preg_match("/media (.*)/", $mediaopt, $matches);
|
||||
if (preg_match("/(.*) mediaopt (.*)/", $matches[1], $matches1)){
|
||||
// there is media + mediaopt like "media 1000baseT mediaopt full-duplex"
|
||||
array_push($mediaopts_list, $matches1[1] . " " . $matches1[2]);
|
||||
} else {
|
||||
// there is only media like "media 1000baseT"
|
||||
array_push($mediaopts_list, $matches[1]);
|
||||
$optlist_intf = get_parent_interface($pconfig['if']);
|
||||
if (count($optlist_intf) > 0) {
|
||||
exec("/sbin/ifconfig -m {$optlist_intf[0]} | grep \"media \"", $mediaopts);
|
||||
foreach ($mediaopts as $mediaopt){
|
||||
preg_match("/media (.*)/", $mediaopt, $matches);
|
||||
if (preg_match("/(.*) mediaopt (.*)/", $matches[1], $matches1)){
|
||||
// there is media + mediaopt like "media 1000baseT mediaopt full-duplex"
|
||||
array_push($mediaopts_list, $matches1[1] . " " . $matches1[2]);
|
||||
} else {
|
||||
// there is only media like "media 1000baseT"
|
||||
array_push($mediaopts_list, $matches[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user