Skip to content

Commit 59b28a6

Browse files
committed
modem_scan:resolve unexpected exit when associated USB is configured but not present.
1 parent b5943f3 commit 59b28a6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,9 @@ scan_pcie_slot_interfaces()
186186
echo "net_devices: $net_devices dun_devices: $dun_devices"
187187
at_ports="$dun_devices"
188188
[ -n "$net_devices" ] && get_associate_usb $slot
189-
if [ -n "$associated_usb" ]; then
189+
if [ -n "$associated_usb" ] && [ -d "/sys/bus/usb/devices/$associated_usb" ]; then
190190
echo checking associated_usb: $associated_usb
191191
local assoc_usb_path="/sys/bus/usb/devices/$associated_usb"
192-
[ ! -d "$assoc_usb_path" ] && return
193192
local slot_interfaces=$(ls $assoc_usb_path | grep -E "$associated_usb:[0-9]\.[0-9]+")
194193
echo checking slot_interfaces: $slot_interfaces
195194
for interface in $slot_interfaces; do
@@ -216,7 +215,6 @@ scan_pcie_slot_interfaces()
216215
done
217216
at_ports="$dun_devices $tty_devices"
218217
fi
219-
220218
validate_at_port
221219
}
222220

0 commit comments

Comments
 (0)