From 73b61f967a20a178df24bc98e2db93d6403d68e4 Mon Sep 17 00:00:00 2001 From: fujr Date: Thu, 3 Apr 2025 19:24:20 +0800 Subject: [PATCH] fix: modem scan --- luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh | 8 ++++++-- luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh | 4 +--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh index 44548bb..423e4d8 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh @@ -311,8 +311,12 @@ add() #section name is replace slot .:- with _ section_name=$(echo $slot | sed 's/[\.:-]/_/g') is_exist=$(uci -q get qmodem.$section_name) - is_fixed_device=$(uci -q get qmodem.@qmodem[0].fixed_device) - [ -n "$is_fixed_device" ] && [ "$is_fixed_device" == "1" ] && return + is_fixed_device=$(uci -q get qmodem.${section_name}.fixed_device) + if [ "$is_fixed_device" == "1" ];then + m_debug "modem $modem_name slot $slot slot_type $slot_type is fixed device, skip" + lock -u /tmp/lock/modem_add_$slot + return + fi case $slot_type in "usb") scan_usb_slot_interfaces $slot diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh index f8c3675..0a54a74 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_util.sh @@ -19,9 +19,7 @@ fastat() local atcmd="${new_str/\"/\"}" #过滤空行 # sms_tool_q -t 1 -d $at_port at "$atcmd" - local at_port_num=${at_port##ttyUSB} - sendat "$at_port_num" "$atcmd" - #tom_modem -d $at_port -o a -c "$atcmd" -t 1 + tom_modem -d $at_port -o a -c "$atcmd" -t 1 } log2file()