Try different paths for vcgencmd
This commit is contained in:
parent
30a21e5d2e
commit
9899e7aa98
1 changed files with 12 additions and 1 deletions
|
@ -10,6 +10,17 @@ if [ $? -ne 0 ]; then
|
||||||
exit -2
|
exit -2
|
||||||
fi
|
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
|
WARN=50
|
||||||
CRIT=70
|
CRIT=70
|
||||||
|
@ -62,7 +73,7 @@ function log {
|
||||||
NL=$'\n'
|
NL=$'\n'
|
||||||
|
|
||||||
|
|
||||||
output=$(/opt/vc/bin/vcgencmd measure_temp)
|
output=$($pathToVcGenCmd measure_temp)
|
||||||
result=$?
|
result=$?
|
||||||
log vcgencmd: $result. $output
|
log vcgencmd: $result. $output
|
||||||
if [ $result -ne 0 ]; then
|
if [ $result -ne 0 ]; then
|
||||||
|
|
Loading…
Reference in a new issue