From 2c6450b1afcd426e3b9cc5d33dcb590fee161360 Mon Sep 17 00:00:00 2001 From: ling <1042585959@qq.com> Date: Sat, 13 Apr 2024 22:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=80=E4=BA=9B=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E7=9A=84FM350=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../root/usr/share/modem/modem_network_task.sh | 5 ++++- luci-app-modem/root/usr/share/modem/modem_util.sh | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/luci-app-modem/root/usr/share/modem/modem_network_task.sh b/luci-app-modem/root/usr/share/modem/modem_network_task.sh index 2c94c4e..65211ab 100755 --- a/luci-app-modem/root/usr/share/modem/modem_network_task.sh +++ b/luci-app-modem/root/usr/share/modem/modem_network_task.sh @@ -127,6 +127,9 @@ rndis_dial() # $2:连接定义 modemmanager_dial() { + local interface_name="$1" + local define_connect="$2" + #激活 local at_command="AT+CGACT=1,${define_connect}" #打印日志 @@ -134,7 +137,7 @@ modemmanager_dial() at "${at_port}" "${at_command}" #启动网络接口 - ifup "$1"; + ifup "${interface_name}"; } #检查模组网络连接 diff --git a/luci-app-modem/root/usr/share/modem/modem_util.sh b/luci-app-modem/root/usr/share/modem/modem_util.sh index 3eee9e8..e0ba591 100755 --- a/luci-app-modem/root/usr/share/modem/modem_util.sh +++ b/luci-app-modem/root/usr/share/modem/modem_util.sh @@ -348,12 +348,13 @@ retry_set_modem_config() modem_name=$(at ${at_port} ${at_command} | sed -n '2p' | sed 's/\r//g' | tr 'A-Z' 'a-z') } - #特殊处理FM350-GL-00 5G Module - [[ "$modem_name" = *"fm350-gl"* ]] && { - modem_name="fm350-gl" - } - [ -n "$modem_name" ] && { + + #特殊处理FM350-GL-00 5G Module + [[ "$modem_name" = *"fm350-gl"* ]] && { + modem_name="fm350-gl" + } + #获取模组信息 local data_interface=$(uci -q get modem.modem${modem_no}.data_interface) local modem_info=$(echo ${modem_support} | jq '.modem_support.'$data_interface'."'$modem_name'"')