|
发表于 2021-2-27 01:16:01
|
显示全部楼层
temp1=`cat /tmp/smart/smart_0_1.info | grep 194 | awk -F, '{print $6}'`
temp2=`cat /tmp/smart/smart_0_2.info | grep 194 | awk -F, '{print $6}'`
if [ $temp1 -ge 36 -o $temp2 -ge 36 ]
then
echo 1 > /sys/class/gpio/gpio42/value
echo `date +'%Y-%m-%d %H:%M'` '硬盘温度:'$temp1'℃ \'$temp2'℃,启动风扇' >> /var/log/fan.log
else
if [ $temp1 -le 28 -a $temp1 -le 28 ]
then
echo 0 > /sys/class/gpio/gpio42/value
echo `date +'%Y-%m-%d %H:%M'` '硬盘温度:'$temp1'℃ \'$temp2'℃,关闭风扇' >> /var/log/fan.log
else
echo `date +'%Y-%m-%d %H:%M'` '硬盘温度:'$temp1'℃ \'$temp2'℃' >> /var/log/fan.log
fi
fi
exit |
|