diff options
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 3fa3abe..f0b016e 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1649,4 +1649,21 @@ function load_glxsb() { } } +/****f* pfsense-utils/isvm + * NAME + * isvm + * INPUTS + * none + * RESULT + * returns true if machine is running under a virtual environment + ******/ +function isvm() { + $virtualenvs = array("vmware", "parallels", "qemu", "bochs", "plex86"); + $bios_vendor = strtolower(`/bin/kenv | /usr/bin/grep "bios.vendor" | /usr/bin/cut -d"=" -f2`); + if(in_array($bios_vendor, $virtualenvs)) + return true; + else + return false; +} + ?>
\ No newline at end of file |