From c645776d1916b411d60dc81d38a7fccb3f3cc220 Mon Sep 17 00:00:00 2001 From: wukongdaily <2666180@gmail.com> Date: Mon, 19 May 2025 21:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A3=8E=E6=89=87?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=B8=A9=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be3600.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/be3600.sh b/be3600.sh index a1518e2..38d627e 100644 --- a/be3600.sh +++ b/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 clear gl_name=$(get_router_name) @@ -316,6 +343,7 @@ while true; do echo light_magenta " 6. 隐藏首页格式化按钮" echo + light_magenta " 7. 自定义风扇启动温度" echo " Q. 退出本程序" echo read -p "请选择一个选项: " choice @@ -350,6 +378,9 @@ while true; do 6) hide_homepage_format_button ;; + 7) + set_glfan_temp + ;; q | Q) echo "退出" exit 0