mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-12 13:49:38 +02:00
fix CPU temp error on X86
This commit is contained in:
parent
f7eee12720
commit
47129dd0d1
@ -41,7 +41,7 @@ echo ""
|
||||
echo "*** CHECK BASE IMAGE ***"
|
||||
|
||||
# armv7=32Bit , armv8=64Bit
|
||||
echo "Check if Linux ARM based ..."
|
||||
echo "Detect CPU architecture ..."
|
||||
isARM=$(uname -m | grep -c 'arm')
|
||||
isAARCH64=$(uname -m | grep -c 'aarch64')
|
||||
isX86_64=$(uname -m | grep -c 'x86_64')
|
||||
|
@ -50,7 +50,11 @@ lnd_macaroon_dir="/home/bitcoin/.lnd/data/chain/${network}/${chain}net"
|
||||
load=$(w | head -n 1 | cut -d 'v' -f2 | cut -d ':' -f2)
|
||||
|
||||
# get CPU temp
|
||||
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||
isX86_64=$(uname -m | grep -c 'x86_64')
|
||||
cpu=0
|
||||
if [ ${isX86_64} -eq 0 ] ; then
|
||||
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||
fi
|
||||
tempC=$((cpu/1000))
|
||||
tempF=$(((cpu/1000) * (9/5) + 32))
|
||||
|
||||
|
@ -21,7 +21,11 @@ localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1
|
||||
echo "localIP='${localip}'"
|
||||
|
||||
# temp
|
||||
tempC=$(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc)
|
||||
isX86_64=$(uname -m | grep -c 'x86_64')
|
||||
tempC=0
|
||||
if [ ${isX86_64} -eq 0 ] ; then
|
||||
tempC=$(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc)
|
||||
fi
|
||||
echo "tempCelsius='${tempC}'"
|
||||
|
||||
# uptime in seconds
|
||||
|
Loading…
x
Reference in New Issue
Block a user