Try different paths for vcgencmd

This commit is contained in:
root 2022-07-15 19:01:29 +01:00
parent 30a21e5d2e
commit 9899e7aa98
1 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,17 @@ if [ $? -ne 0 ]; then
exit -2
fi
pathToVcGenCmd=/usr/bin/vcgencmd
if [ ! -x "$pathToVcGenCmd" ]; then
pathToVcGenCmd=/opt/vc/bin/vcgencmd
fi
if [ ! -x "$pathToVcGenCmd" ]; then
pathToVcGenCmd=$(which vcgencmd 2> /dev/null)
fi
if [ ! -x "$pathToVcGenCmd" ]; then
echoerr Cannot find vcgencmd
exit -3
fi
WARN=50
CRIT=70
@ -62,7 +73,7 @@ function log {
NL=$'\n'
output=$(/opt/vc/bin/vcgencmd measure_temp)
output=$($pathToVcGenCmd measure_temp)
result=$?
log vcgencmd: $result. $output
if [ $result -ne 0 ]; then