0%

万由 NAS 201P 风扇控制脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash


modprobe i2c-dev

tcpu=20
thdd=20

tcpu=$(sensors | tail -n +7 | head -n +1 | cut -b 17,18)
thdd=$(hddtemp /dev/sda | cut -b 36,37)

sum=$(( $tcpu + $thdd - 10 ))

echo "$sum is fan speed" > /root/fan.txt
echo "$tcpu is CPU temp " >> /root/fan.txt
echo "$thdd is HDD temp " >> /root/fan.txt
date >> /root/fan.txt

i2cset -y 0 0x54 0xf0 $sum