mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Correctly convert a friendly interface name (DESCRIPTION) to the real interface id for optional interfaces
This commit is contained in:
parent
31a822333a
commit
54f4caedee
@ -505,7 +505,14 @@ function execute_command_return_output($command) {
|
||||
* convert_friendly_interface_to_real_interface_name($interface): convert WAN to FXP0
|
||||
*/
|
||||
function convert_friendly_interface_to_real_interface_name($interface) {
|
||||
return $config['interfaces'][$interface]['if'];
|
||||
global $config;
|
||||
if($interface == "lan") return $config['interfaces']['lan']['if'];
|
||||
if($interface == "wan") return $config['interfaces']['lan']['if'];
|
||||
foreach($config['interfaces'] as $int) {
|
||||
if($int['descr'] == $interface)
|
||||
return $int['if'];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user