diff options
author | Warren Baker <warren@decoy.co.za> | 2013-04-26 10:35:06 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2013-04-26 10:35:06 +0200 |
commit | 58897b8cc200def6192345a3fe3058fb7ebc9cb5 (patch) | |
tree | aa432713d4322b21f349985179c88afb042e24de /etc/inc/pfsense-utils.inc | |
parent | 187250859872e06d3144d041ee577421039fbb5d (diff) | |
download | pfsense-58897b8cc200def6192345a3fe3058fb7ebc9cb5.zip pfsense-58897b8cc200def6192345a3fe3058fb7ebc9cb5.tar.gz |
Fix isvm check to match on product
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 7c53885..11bc42d 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1598,11 +1598,12 @@ function load_thermal_hardware() { ******/ function isvm() { $virtualenvs = array("vmware", "parallels", "qemu", "bochs", "plex86"); - $bios_vendor = strtolower(`/bin/kenv | /usr/bin/awk -F= '/smbios.bios.vendor/ {print $2}'`); - if(in_array($bios_vendor, $virtualenvs)) - return true; - else - return false; + $bios_product = trim(`/bin/kenv | /usr/bin/awk -F= '/smbios.system.product/ {print $2}'`); + foreach ($virtualenvs as $virtualenv) + if (stripos($bios_product, $virtualenv) !== false) + return true; + + return false; } function get_freebsd_version() { |