mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-25 19:21:57 +02:00
fix CPU temp error on X86
This commit is contained in:
@@ -41,7 +41,7 @@ echo ""
|
|||||||
echo "*** CHECK BASE IMAGE ***"
|
echo "*** CHECK BASE IMAGE ***"
|
||||||
|
|
||||||
# armv7=32Bit , armv8=64Bit
|
# armv7=32Bit , armv8=64Bit
|
||||||
echo "Check if Linux ARM based ..."
|
echo "Detect CPU architecture ..."
|
||||||
isARM=$(uname -m | grep -c 'arm')
|
isARM=$(uname -m | grep -c 'arm')
|
||||||
isAARCH64=$(uname -m | grep -c 'aarch64')
|
isAARCH64=$(uname -m | grep -c 'aarch64')
|
||||||
isX86_64=$(uname -m | grep -c 'x86_64')
|
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)
|
load=$(w | head -n 1 | cut -d 'v' -f2 | cut -d ':' -f2)
|
||||||
|
|
||||||
# get CPU temp
|
# 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))
|
tempC=$((cpu/1000))
|
||||||
tempF=$(((cpu/1000) * (9/5) + 32))
|
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}'"
|
echo "localIP='${localip}'"
|
||||||
|
|
||||||
# temp
|
# 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}'"
|
echo "tempCelsius='${tempC}'"
|
||||||
|
|
||||||
# uptime in seconds
|
# uptime in seconds
|
||||||
|
Reference in New Issue
Block a user