mirror of https://github.com/CISOfy/lynis.git
Removed unneeded complexity regarding dmidecode, as binary checks are already done at this point
This commit is contained in:
parent
4ff61a6f46
commit
53ad72e791
|
@ -1774,14 +1774,9 @@
|
||||||
# dmidecode
|
# dmidecode
|
||||||
# Values: VMware Virtual Platform / VirtualBox
|
# Values: VMware Virtual Platform / VirtualBox
|
||||||
if [ -z "${SHORT}" ]; then
|
if [ -z "${SHORT}" ]; then
|
||||||
if [ -x /usr/bin/dmidecode ]; then DMIDECODE_BINARY="/usr/bin/dmidecode"
|
if [ -n "${DMIDECODEBINARY}" -a -x "${DMIDECODEBINARY}" -a ${PRIVILEGED} -eq 1 ]; then
|
||||||
elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode"
|
|
||||||
else
|
|
||||||
DMIDECODE_BINARY=""
|
|
||||||
fi
|
|
||||||
if [ ! "${DMIDECODE_BINARY}" = "" -a ${PRIVILEGED} -eq 1 ]; then
|
|
||||||
LogText "Test: trying to guess virtualization with dmidecode"
|
LogText "Test: trying to guess virtualization with dmidecode"
|
||||||
FIND=$(/usr/sbin/dmidecode -s system-product-name | awk '{ print $1 }')
|
FIND=$(${DMIDECODEBINARY} -s system-product-name | awk '{ print $1 }')
|
||||||
if [ -n "${FIND}" ]; then
|
if [ -n "${FIND}" ]; then
|
||||||
LogText "Result: found ${FIND}"
|
LogText "Result: found ${FIND}"
|
||||||
SHORT="${FIND}"
|
SHORT="${FIND}"
|
||||||
|
@ -1794,6 +1789,7 @@
|
||||||
else
|
else
|
||||||
LogText "Result: skipped dmidecode test, as we already found machine type"
|
LogText "Result: skipped dmidecode test, as we already found machine type"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Other options
|
# Other options
|
||||||
# SaltStack: salt-call grains.get virtual
|
# SaltStack: salt-call grains.get virtual
|
||||||
# < needs snippet >
|
# < needs snippet >
|
||||||
|
|
Loading…
Reference in New Issue