Removed unneeded complexity regarding dmidecode, as binary checks are already done at this point

This commit is contained in:
Michael Boelen 2020-03-31 16:25:27 +02:00
parent 4ff61a6f46
commit 53ad72e791
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
1 changed files with 3 additions and 7 deletions

View File

@ -1774,14 +1774,9 @@
# dmidecode
# Values: VMware Virtual Platform / VirtualBox
if [ -z "${SHORT}" ]; then
if [ -x /usr/bin/dmidecode ]; then DMIDECODE_BINARY="/usr/bin/dmidecode"
elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode"
else
DMIDECODE_BINARY=""
fi
if [ ! "${DMIDECODE_BINARY}" = "" -a ${PRIVILEGED} -eq 1 ]; then
if [ -n "${DMIDECODEBINARY}" -a -x "${DMIDECODEBINARY}" -a ${PRIVILEGED} -eq 1 ]; then
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
LogText "Result: found ${FIND}"
SHORT="${FIND}"
@ -1794,6 +1789,7 @@
else
LogText "Result: skipped dmidecode test, as we already found machine type"
fi
# Other options
# SaltStack: salt-call grains.get virtual
# < needs snippet >