summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network
diff options
context:
space:
mode:
authorDmitry Tunin <hanipouspilot@gmail.com>2018-07-29 02:53:01 +0300
committerDmitry Tunin <hanipouspilot@gmail.com>2018-07-29 02:53:01 +0300
commit95c38dab8f4e97bf35ae07f5ab060eab1f23fe42 (patch)
tree982ced3ef02ec95eeab8c5bead31d0de31e71c32 /protocols/luci-proto-ncm/luasrc/model/cbi/admin_network
parentc27a77756c718a0b3babd510f83850bd9e2ac431 (diff)
luci-proto-ncm: suggest both tty and wdm devices
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>
Diffstat (limited to 'protocols/luci-proto-ncm/luasrc/model/cbi/admin_network')
-rw-r--r--protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua b/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua
index b258dfc598..318db7e774 100644
--- a/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua
+++ b/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua
@@ -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"))