diff options
author | Colin Smith <colin@pfsense.org> | 2005-07-14 04:35:21 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-07-14 04:35:21 +0000 |
commit | 4d0274920b49cbafbf890213e21c3123bbac42b9 (patch) | |
tree | 2eb65785b1751ac9a13de3083f5a2d320308c19a /etc/inc/pfsense-utils.inc | |
parent | 3cb6f873fdbf827c9771983c19a40f484f33d9f7 (diff) | |
download | pfsense-4d0274920b49cbafbf890213e21c3123bbac42b9.zip pfsense-4d0274920b49cbafbf890213e21c3123bbac42b9.tar.gz |
* Use awk instead of grep/cut.
* trim() instead of str_replace().
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 4 |
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 |