getInfo 2.4.1

This commit is contained in:
kyodev 2017-10-13 01:15:30 +02:00
parent 1892e0602a
commit d557c5d313
2 changed files with 16 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.4.0
version=2.4.1
date="13/10/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -1264,17 +1264,24 @@ figet_hw(){ # 13/10/2017
input=$(gawk '{printf "%.1f", $1/1000}' <<< $(cat /sys/class/hwmon/$ihw/temp*_input))
crit=$(gawk '{printf "%.1f", $1/1000}' <<< $(cat /sys/class/hwmon/$ihw/temp*_crit 2>/dev/null))
hyst=$(gawk '$0!="" {printf "%.1f", $1/1000}' <<< $(cat /sys/class/hwmon/$ihw/temp*_crit_hyst 2>/dev/null))
max=$(gawk '$0!="" {printf "%.1f", $1/1000}' <<< $(cat /sys/class/hwmon/$ihw/temp*_max 2>/dev/null))
if grep -q 'core' <<< $(cat /sys/class/hwmon/$ihw/name) ; then
nbc=$(( nbc+1 ))
core+="core$nbc $input""°C (crit: $crit""°C)"
[ "$hyst" ] && core+="($hyst""°C)"$' \n'
core+="core$nbc $input""°C "
[ "$max" ] && core+="(max: $mac""°C) "
[ "$crit" ] && core+="(crit: $crit""°C) "
[ "$hyst" ] && core+="(hyst: $hyst""°C) "
[ "$core" ] && core+=$' \n'
else
autre+="$(cat /sys/class/hwmon/$ihw/name) $input""°C (crit: $crit""°C)"
[ "$hyst" ] && autre+="(hyst: $hyst""°C)"$' \n'
autre+="$(cat /sys/class/hwmon/$ihw/name) $input""°C "
[ "$max" ] && autre+="(max: $mac""°C) "
[ "$crit" ] && autre+="(crit: $crit""°C) "
[ "$hyst" ] && autre+="(hyst: $hyst""°C) "
[ "$autre" ] && autre+=$' \n'
fi
fi
done
fget_hw="$core"$' \n'"$autre"$' \n'"$fan"
fget_hw="$core$autre$fan"
fget_hw=${fget_hw::-1} # suppression dernier $'\n'
}

View File

@ -9,9 +9,10 @@
---
## 2.4.0 13/10/2017
## 2.4.1 13/10/2017
* révision: fix figet_hw_test +sensors si possible +figet_hw
* révision: fix figet_hw_test: +sensors si possible +figet_hw
* mieux: figet_hw autres seuils de température
* fix: figet_hw formatage float
## 2.3.0 12/10/2017