diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-02-04 07:42:51 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-04 07:43:06 -0200 |
commit | 7e36f71c32f11ec322abd42d12b6b3160c09a721 (patch) | |
tree | c186526d863f313a270bdb2ebad2568082c8624f /etc/inc/pfsense-utils.inc | |
parent | d7f4c1a42def0b2db12db56c11a6d1949129122d (diff) | |
download | pfsense-7e36f71c32f11ec322abd42d12b6b3160c09a721.zip pfsense-7e36f71c32f11ec322abd42d12b6b3160c09a721.tar.gz |
Silent kenv when smbios.system.product is not present. While here, add VirtualBox to the list of virtualenvs
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 36640aa..7fcb000 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1630,10 +1630,14 @@ function load_thermal_hardware() { * returns true if machine is running under a virtual environment ******/ function isvm() { - $virtualenvs = array("vmware", "parallels", "qemu", "bochs", "plex86"); - $bios_product = trim(`/bin/kenv smbios.system.product`); + $virtualenvs = array("vmware", "parallels", "qemu", "bochs", "plex86", "VirtualBox"); + $_gb = exec('/bin/kenv smbios.system.product 2>/dev/null', $output, $rc); + + if ($rc != 0 || !isset($output[0])) + return false; + foreach ($virtualenvs as $virtualenv) - if (stripos($bios_product, $virtualenv) !== false) + if (stripos($output[0], $virtualenv) !== false) return true; return false; |