diff options
author | Warren Baker <warren@decoy.co.za> | 2013-04-26 10:37:22 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2013-04-26 10:37:22 +0200 |
commit | aa72848dd20d2f6c935e19bfba3e15c4d72fcc97 (patch) | |
tree | 8234fec8aa46afe6d130b3d0a3f9c6d2318ed079 | |
parent | 2ddc9ed9ad8667e26763123f6257e0217d5f7a27 (diff) | |
download | pfsense-aa72848dd20d2f6c935e19bfba3e15c4d72fcc97.zip pfsense-aa72848dd20d2f6c935e19bfba3e15c4d72fcc97.tar.gz |
Fix isvm check to match on product
-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 0a0cf68..579331b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1464,11 +1464,12 @@ function load_glxsb() { ******/ 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() { |