diff --git a/CoreTemp.sh b/CoreTemp.sh new file mode 100755 index 0000000..5d82edb --- /dev/null +++ b/CoreTemp.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Read Core temperature for different CPUs (Intel and AMD) +# +# (c) GPL by Ulf Bartholomäus ub1x@gmx.net +VERSION="$( basename $0 ) Version 0.1.1 from 19.04.2022" +# +# Input: n/a +# Output: temperatur +# Returnvalue: n/a +# +# +# Changes: +# 0.1.1: initial version + + +mySensors=$(sensors) +#amd old +if [ "${mySensors/k10}" != "${mySensors}" ] ; then + sensors | sed -nE 's/^Tdie: *([^ ]*)/{\1}/p' +#amd new +elif [ "${mySensors/Tctl}" != "${mySensors}" ] ; then + sensors | sed -nE 's/^Tctl: *([^ ]*)/\1/p' +#intel +elif [ "${mySensors/core}" != "${mySensors}" ]] ; then + sensors | sed -ne 's/^Core*//p' | sed 's/°C.*/°C/' | sed 's/.*+/+/' +fi diff --git a/README.md b/README.md index e86e847..a393909 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,5 @@ See also at [LUG-VS-Wiki Nützliche Scripte](https://lug-vs.org//lugvswiki/index |[wmf2svg.sh](wmf2svg.sh)|Example script converts WMF files in SVG to share it easily on the internet| |[write-exif-comment.sh](write-exif-comment.sh)|Write JPEG EXIF comment in all *.jpg files| |[CheckBackup.sh](CheckBackup.sh)|Check if the anacron tasks and give the status of the next backup| +|[CoreTemp.sh](CoreTemp.sh)|Read Core Temperature from Intel and AMD CPUs| +