Browse Source

fix CPU temp error on X86

master
openoms 6 years ago
parent
commit
47129dd0d1
  1. 2
      build_sdcard.sh
  2. 6
      home.admin/00infoBlitz.sh
  3. 6
      home.admin/config.scripts/blitz.statusscan.sh

2
build_sdcard.sh

@ -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')

6
home.admin/00infoBlitz.sh

@ -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))

6
home.admin/config.scripts/blitz.statusscan.sh

@ -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…
Cancel
Save