luci-proto-ncm: suggest both tty and wdm devices 1989/head
authorDmitry Tunin <hanipouspilot@gmail.com>
Sat, 28 Jul 2018 23:53:01 +0000 (02:53 +0300)
committerDmitry Tunin <hanipouspilot@gmail.com>
Sat, 28 Jul 2018 23:53:01 +0000 (02:53 +0300)
Some modems are controlled only through a tty.
Autodetection of control device is broken in ncm.sh

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua

index b258dfc5982fb9ea8dbbd671b718de496fdcd0c3..318db7e774a215aac81464ac5f5263b3fe4abbab 100644 (file)
@@ -19,16 +19,13 @@ local ipv6, delay, defaultroute, metric, peerdns, dns
 device = section:taboption("general", Value, "device", translate("Modem device"))
 device.rmempty = false
 
-local device_suggestions = nixio.fs.glob("/dev/cdc-wdm*")
-       or nixio.fs.glob("/dev/ttyUSB*")
-
-if device_suggestions then
-       local node
-       for node in device_suggestions do
-               device:value(node)
-       end
+local dev
+for dev in nixio.fs.glob("/dev/ttyUSB*") do
+    device:value(dev)
+end
+for dev in nixio.fs.glob("/dev/cdc-wdm*") do
+    device:value(dev)
 end
-
 
 mode = section:taboption("general", Value, "mode", translate("Service Type"))
 mode:value("", translate("Modem default"))