summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pfsense-utils.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 8a07ae7..34d7125 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -59,8 +59,8 @@ function log_error($error) {
* $mac - the mac address of the interface
******/
function get_interface_mac_address($interface) {
- $mac = exec('ifconfig ' . $interface . ' | grep ether | cut -d" " -f 2');
- return str_replace(array("\n", "\r"), "", $mac);
+ $mac = exec("ifconfig {$interface} | awk '/ether/ {print $2}'");
+ return trim($mac);
}
/****f* pfsense-utils/return_dir_as_array
OpenPOWER on IntegriCloud