mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 00:04:16 +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
|
# 0 = no, 1 = yes, 2 = unknown
|
||||||
ISVIRTUALMACHINE=2; VMTYPE="unknown"; VMFULLTYPE="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=""
|
SHORT=""
|
||||||
|
|
||||||
# Trying systemd
|
# Trying systemd
|
||||||
@ -601,6 +614,13 @@
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# # dmidecode
|
||||||
|
# if [ "${SHORT}" = "" ]; then
|
||||||
|
# if [ -x /usr/sbin/dmidecode ]; then
|
||||||
|
# SHORT=`dmidecode -s system-product-name`
|
||||||
|
# fi
|
||||||
|
# fi
|
||||||
|
|
||||||
# lshw
|
# lshw
|
||||||
if [ "${SHORT}" = "" ]; then
|
if [ "${SHORT}" = "" ]; then
|
||||||
if [ -x /usr/bin/lshw ]; then
|
if [ -x /usr/bin/lshw ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user