1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Check if we have a return from mmcli -L before using it in Wizard

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-09-11 08:35:15 +02:00
parent 3a7669aef0
commit 1e705d2cb5

View file

@ -46,6 +46,7 @@
alltty = {}
iftty = luci.sys.exec("timeout 1 /usr/bin/mmcli -L")
if iftty ~= nil then
for listtty in iftty:gmatch("([^\r\n]*)[\r\n]") do
modemid = luci.util.trim(luci.sys.exec("echo '" .. listtty .. "' | awk -F' ' '{print $1}' | awk -F/ '{print $6}'"))
if modemid ~= '' then
@ -54,6 +55,7 @@
table.insert(alltty, tty)
end
end
end
%>