sensors: add more

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-05-19 16:42:30 +02:00
parent b32ad4fba0
commit 80acecae17
2 changed files with 11 additions and 7 deletions

Binary file not shown.

View File

@ -16,10 +16,14 @@ if [[ ! -x $(which perl) ]]; then
exit 1 exit 1
fi fi
modprobe -q it87
modprobe -q adt7470
modprobe -q adt7475
modprobe -q nct6683
modprobe -q nct6775
modprobe -q coretemp modprobe -q coretemp
modprobe -q k10temp modprobe -q k10temp
modprobe -q it87
modprobe -q adt7475
echo 'Y' | sensors-detect --auto >/tmp/sensors.log echo 'Y' | sensors-detect --auto >/tmp/sensors.log
cat /tmp/sensors.log | grep Driver | awk '{print $2}' cat /tmp/sensors.log | grep Driver | awk '{print $2}'
@ -36,14 +40,14 @@ if [ ! -f /etc/fancontrol ]; then
MAXTEMP="" MAXTEMP=""
MINSTART="" MINSTART=""
MINSTOP="" MINSTOP=""
CORETEMP=$(find /sys/devices/platform/ -name temp1_input | grep -E 'coretemp|k10temp' | sed -n -e 's|.*/\(hwmon.*\/temp1_input\).*|\1|p') CORETEMP="$(find /sys/devices/platform/ -name temp1_input | grep -E 'coretemp|k10temp' | sed -n -e 's|.*/\(hwmon.*\/temp1_input\).*|\1|p')"
for P in $(find /sys/devices/platform/ -name temp1_input); do for P in $(find /sys/devices/platform/ -name temp1_input); do
D=$(echo ${P} | sed -n -e 's|.*/\(devices/platform/[^/]*\)/.*|\1|p') D="$(echo ${P} | sed -n -e 's|.*/\(devices/platform/[^/]*\)/.*|\1|p')"
I=$(echo ${P} | sed -n -e 's|.*hwmon\([0-9]\).*|\1|p') I="$(echo ${P} | sed -n -e 's|.*hwmon\([0-9]\).*|\1|p')"
DEVPATH="${DEVPATH} hwmon${I}=${D}" DEVPATH="${DEVPATH} hwmon${I}=${D}"
DEVNAME="${DEVNAME} hwmon${I}=$(cat /sys/${D}/*/*/name)" DEVNAME="${DEVNAME} hwmon${I}=$(cat /sys/${D}/*/*/name)"
for F in $(find "/sys/${D}" -name "fan[0-9]_input"); do for F in $(find "/sys/${D}" -name "fan[0-9]_input"); do
IDX=$(echo ${F} | sed -n -e 's|.*fan\([0-9]\)_input|\1|p') IDX="$(echo ${F} | sed -n -e 's|.*fan\([0-9]\)_input|\1|p')"
FCTEMPS="${FCTEMPS} hwmon${I}/pwm${IDX}=${CORETEMP}" FCTEMPS="${FCTEMPS} hwmon${I}/pwm${IDX}=${CORETEMP}"
FCFANS="${FCFANS} hwmon${I}/pwm${IDX}=hwmon${I}/fan${IDX}_input" FCFANS="${FCFANS} hwmon${I}/pwm${IDX}=hwmon${I}/fan${IDX}_input"
MINTEMP="${MINTEMP} hwmon${I}/pwm${IDX}=30" MINTEMP="${MINTEMP} hwmon${I}/pwm${IDX}=30"
@ -70,4 +74,4 @@ fi
killall fancontrol killall fancontrol
fancontrol & fancontrol &
exit 0 exit 0