diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 61106abcd2..900006668b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -115,6 +115,14 @@ function convert_ip_to_network_format($ip, $subnet) { return $string; } +/* + * find_interface_ip($interface): return the interface ip (first found) + */ +function find_interface_ip($interface) { + $ip = system("/sbin/ifconfig {$interface} | grep \"inet \" | cut -d\" \" -f 2"); + return $ip; +} + /* * find_ip_interface($ip): return the interface where an ip is defined */