summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2013-04-26 10:37:22 +0200
committerWarren Baker <warren@decoy.co.za>2013-04-26 10:37:22 +0200
commitaa72848dd20d2f6c935e19bfba3e15c4d72fcc97 (patch)
tree8234fec8aa46afe6d130b3d0a3f9c6d2318ed079
parent2ddc9ed9ad8667e26763123f6257e0217d5f7a27 (diff)
downloadpfsense-aa72848dd20d2f6c935e19bfba3e15c4d72fcc97.zip
pfsense-aa72848dd20d2f6c935e19bfba3e15c4d72fcc97.tar.gz
Fix isvm check to match on product
-rw-r--r--etc/inc/pfsense-utils.inc11
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() {
OpenPOWER on IntegriCloud