自定义风扇启动温度
This commit is contained in:
parent
eea92433de
commit
c645776d19
31
be3600.sh
31
be3600.sh
@ -294,6 +294,33 @@ EOF
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#自定义风扇开始工作的温度
|
||||||
|
set_glfan_temp() {
|
||||||
|
|
||||||
|
is_integer() {
|
||||||
|
if [[ $1 =~ ^[0-9]+$ ]]; then
|
||||||
|
return 0 # 是整数
|
||||||
|
else
|
||||||
|
return 1 # 不是整数
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
echo "兼容带风扇机型的GL-iNet路由器"
|
||||||
|
echo "请输入风扇开始工作的温度(建议40-70之间的整数):"
|
||||||
|
read temp
|
||||||
|
|
||||||
|
if is_integer "$temp"; then
|
||||||
|
uci set glfan.@globals[0].temperature="$temp"
|
||||||
|
uci set glfan.@globals[0].warn_temperature="$temp"
|
||||||
|
uci set glfan.@globals[0].integration=4
|
||||||
|
uci set glfan.@globals[0].differential=20
|
||||||
|
uci commit glfan
|
||||||
|
/etc/init.d/gl_fan restart
|
||||||
|
echo "设置成功!稍等片刻,请查看风扇转动情况"
|
||||||
|
else
|
||||||
|
echo "错误: 请输入整数."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
clear
|
||||||
gl_name=$(get_router_name)
|
gl_name=$(get_router_name)
|
||||||
@ -316,6 +343,7 @@ while true; do
|
|||||||
echo
|
echo
|
||||||
light_magenta " 6. 隐藏首页格式化按钮"
|
light_magenta " 6. 隐藏首页格式化按钮"
|
||||||
echo
|
echo
|
||||||
|
light_magenta " 7. 自定义风扇启动温度"
|
||||||
echo " Q. 退出本程序"
|
echo " Q. 退出本程序"
|
||||||
echo
|
echo
|
||||||
read -p "请选择一个选项: " choice
|
read -p "请选择一个选项: " choice
|
||||||
@ -350,6 +378,9 @@ while true; do
|
|||||||
6)
|
6)
|
||||||
hide_homepage_format_button
|
hide_homepage_format_button
|
||||||
;;
|
;;
|
||||||
|
7)
|
||||||
|
set_glfan_temp
|
||||||
|
;;
|
||||||
q | Q)
|
q | Q)
|
||||||
echo "退出"
|
echo "退出"
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user