Browse Source

show 0 C if no temp available in a VM

master
openoms 6 years ago
parent
commit
14d6ced82d
  1. 3
      home.admin/00infoBlitz.sh
  2. 5
      home.admin/config.scripts/blitz.statusscan.sh

3
home.admin/00infoBlitz.sh

@ -50,9 +50,8 @@ 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
isX86_64=$(uname -m | grep -c 'x86_64')
cpu=0
if [ ${isX86_64} -eq 0 ] ; then
if [ -d "/sys/class/thermal/thermal_zone0/" ]; then
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
fi
tempC=$((cpu/1000))

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

@ -21,12 +21,11 @@ localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1
echo "localIP='${localip}'"
# temp
isX86_64=$(uname -m | grep -c 'x86_64')
tempC=0
if [ ${isX86_64} -eq 0 ] ; then
if [ -d "/sys/class/thermal/thermal_zone0/" ]; then
tempC=$(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc)
echo "tempCelsius='${tempC}'"
fi
echo "tempCelsius='${tempC}'"
# uptime in seconds
uptime=$(awk '{printf("%d\n",$1 + 0.5)}' /proc/uptime)

Loading…
Cancel
Save