mirror of
https://github.com/CISOfy/lynis.git
synced 2025-04-08 17:15:25 +02:00
More reliable and often faster check to determine virtualization.
This commit is contained in:
parent
c998924b51
commit
919e48001d
@ -590,6 +590,19 @@
|
||||
# 0 = no, 1 = yes, 2 = unknown
|
||||
ISVIRTUALMACHINE=2; VMTYPE="unknown"; VMFULLTYPE="Unknown"
|
||||
|
||||
# Trying facter
|
||||
if [ -x /usr/bin/facter ]; then
|
||||
case "`facter is_virtual`" in
|
||||
"true")
|
||||
VMTYPE=`facter virtual`
|
||||
logtext "Result: found virtual machine (type: ${VMTYPE})"
|
||||
report "vm=1"
|
||||
report "vmtype=${VMTYPE}"
|
||||
return ;;
|
||||
"false") return ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
SHORT=""
|
||||
|
||||
# Trying systemd
|
||||
@ -601,6 +614,13 @@
|
||||
fi
|
||||
fi
|
||||
|
||||
# # dmidecode
|
||||
# if [ "${SHORT}" = "" ]; then
|
||||
# if [ -x /usr/sbin/dmidecode ]; then
|
||||
# SHORT=`dmidecode -s system-product-name`
|
||||
# fi
|
||||
# fi
|
||||
|
||||
# lshw
|
||||
if [ "${SHORT}" = "" ]; then
|
||||
if [ -x /usr/bin/lshw ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user