mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update fengshan
This commit is contained in:
parent
2f7b2f2987
commit
6d909916bb
1 changed files with 27 additions and 14 deletions
|
@ -1,17 +1,30 @@
|
||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
START=99
|
START=99
|
||||||
start()
|
|
||||||
{
|
# 温度阈值设置
|
||||||
tem=$(cat /sys/class/thermal/thermal_zone0/temp)
|
HIGH_THRESHOLD=60000
|
||||||
echo $tem
|
LOW_THRESHOLD=50000
|
||||||
if [ $tem -ge 60000 ] ; then
|
|
||||||
echo 1 > /sys/class/leds/green:fengshan/brightness;
|
# 读取初始温度值
|
||||||
echo "fengshandoup"
|
temperature=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||||
logger -t "fengshanup"
|
echo "初始温度:$temperature"
|
||||||
elif [ $tem -le 50000 ] ; then
|
|
||||||
echo 0 > /sys/class/leds/green:fengshan/brightness;
|
start() {
|
||||||
echo "fengshandown"
|
while true; do
|
||||||
logger -t "$tem" "fengshandown"
|
temperature=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||||
fi
|
echo "当前温度:$temperature"
|
||||||
}
|
|
||||||
|
if [ "$temperature" -ge "$HIGH_THRESHOLD" ]; then
|
||||||
|
echo 1 > /sys/class/leds/green:fengshan/brightness
|
||||||
|
echo "风扇高转速"
|
||||||
|
logger -t "fengshanup" "温度过高"
|
||||||
|
elif [ "$temperature" -le "$LOW_THRESHOLD" ]; then
|
||||||
|
echo 0 > /sys/class/leds/green:fengshan/brightness
|
||||||
|
echo "风扇低转速"
|
||||||
|
logger -t "fengshandown" "温度正常"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 30 # 设置循环间隔为30秒
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue