Don't show errors when we are running non-privileged

This commit is contained in:
Michael Boelen 2016-05-03 13:11:28 +02:00
parent 062782e7a5
commit dab69d2860
1 changed files with 3 additions and 3 deletions

View File

@ -1019,7 +1019,7 @@
elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode" elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode"
else DMIDECODE_BINARY="" else DMIDECODE_BINARY=""
fi fi
if [ ! "${DMIDECODE_BINARY}" = "" ]; then 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=`/usr/sbin/dmidecode -s system-product-name | awk '{ print $1 }'`
if [ ! "${FIND}" = "" ]; then if [ ! "${FIND}" = "" ]; then
@ -1029,7 +1029,7 @@
LogText "Result: can't find product name with dmidecode" LogText "Result: can't find product name with dmidecode"
fi fi
else else
LogText "Result: dmidecode not found" LogText "Result: dmidecode not found (or no access)"
fi fi
else else
LogText "Result: skipped dmidecode test, as we already found machine type" LogText "Result: skipped dmidecode test, as we already found machine type"
@ -1039,7 +1039,7 @@
if [ "${SHORT}" = "" ]; then if [ "${SHORT}" = "" ]; then
if [ -x /usr/bin/lshw ]; then if [ -x /usr/bin/lshw ]; then
LogText "Test: trying to guess virtualization with lshw" LogText "Test: trying to guess virtualization with lshw"
FIND=`lshw -quiet -class system | awk '{ if ($1=="product:") { print $2 }}'` FIND=`lshw -quiet -class system 2> /dev/null | awk '{ if ($1=="product:") { print $2 }}'`
if [ ! "${FIND}" = "" ]; then if [ ! "${FIND}" = "" ]; then
LogText "Result: found ${FIND}" LogText "Result: found ${FIND}"
SHORT="${FIND}" SHORT="${FIND}"