diff --git a/include/functions b/include/functions index 5b60419f..fd47cd3d 100644 --- a/include/functions +++ b/include/functions @@ -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 >