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