mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Merge branch 'ipq807x' into develop
This commit is contained in:
commit
225754e1fc
67 changed files with 44 additions and 4934 deletions
27
openmptcprouter/files/etc/init.d/fengshan
Executable file
27
openmptcprouter/files/etc/init.d/fengshan
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=20
|
||||
start()
|
||||
{
|
||||
# 温度阈值设置
|
||||
HIGH_THRESHOLD=60000
|
||||
LOW_THRESHOLD=50000
|
||||
|
||||
# 读取初始温度值
|
||||
temperature=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||
echo "初始温度:$temperature"
|
||||
|
||||
# 获取当前温度值
|
||||
temperature=$(cat /sys/class/thermal/thermal_zone0/temp)
|
||||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue