From 59b28a62fdd86b602ee15eedb371f9074d130f1e Mon Sep 17 00:00:00 2001 From: fujr Date: Thu, 17 Apr 2025 23:07:17 +0800 Subject: [PATCH] modem_scan:resolve unexpected exit when associated USB is configured but not present. --- luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh | 4 +--- 1 file changed, 1 insertion(+), 3 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 04b9d76..fdd4628 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 @@ -186,10 +186,9 @@ scan_pcie_slot_interfaces() echo "net_devices: $net_devices dun_devices: $dun_devices" at_ports="$dun_devices" [ -n "$net_devices" ] && get_associate_usb $slot - if [ -n "$associated_usb" ]; then + if [ -n "$associated_usb" ] && [ -d "/sys/bus/usb/devices/$associated_usb" ]; then echo checking associated_usb: $associated_usb local assoc_usb_path="/sys/bus/usb/devices/$associated_usb" - [ ! -d "$assoc_usb_path" ] && return local slot_interfaces=$(ls $assoc_usb_path | grep -E "$associated_usb:[0-9]\.[0-9]+") echo checking slot_interfaces: $slot_interfaces for interface in $slot_interfaces; do @@ -216,7 +215,6 @@ scan_pcie_slot_interfaces() done at_ports="$dun_devices $tty_devices" fi - validate_at_port }