#!/bin/bash hwmon_sysfs="/sys/class/hwmon" list=$(find "$hwmon_sysfs"/*) for i in $list; do if [ -e "$i/name" ]; then sensor="$i" else sensor="$i/device" fi cat "$sensor/name" count=$(find "$sensor"/temp*_input | wc -l) for((j=1; j<=count; j++)); do if [ -e "$sensor"/temp"$j"_label ]; then name=$(awk '{print $1}' < "$sensor"/temp"$j"_label) else name="temp$j" fi if [ -e "$sensor"/temp"$j"_input ]; then temp=$(awk '{print $1}' < "$sensor"/temp"$j"_input) temp=$(echo "scale=2; $temp / 1000" | bc) else temp="N/A" fi echo -ne "$name $temp\n" done echo done