mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Fix wizard modem list error when empty
This commit is contained in:
parent
539a566ada
commit
b9f79acfae
1 changed files with 5 additions and 3 deletions
|
@ -531,12 +531,14 @@ end
|
|||
iffind=0
|
||||
iftty = luci.sys.exec("/usr/bin/mmcli -L")
|
||||
for listtty in iftty:gmatch("([^\r\n]*)[\r\n]") do
|
||||
modemid = luci.sys.exec("echo '" .. listtty .. "' | awk -F' ' '{print $1}' | awk -F/ '{print $6}'")
|
||||
modeminfo = luci.sys.exec("/usr/bin/mmcli -m " .. modemid .. " --output-keyvalue")
|
||||
tty = luci.sys.exec("echo '" .. modeminfo .. "' | grep 'modem.generic.device ' | awk -F': ' '{print $2}'")
|
||||
modemid = luci.util.trim(luci.sys.exec("echo '" .. listtty .. "' | awk -F' ' '{print $1}' | awk -F/ '{print $6}'"))
|
||||
if modemid ~= '' then
|
||||
modeminfo = luci.sys.exec("/usr/bin/mmcli -m " .. modemid .. " --output-keyvalue")
|
||||
tty = luci.util.trim(luci.sys.exec("echo '" .. modeminfo .. "' | grep 'modem.generic.device ' | awk -F': ' '{print $2}'"))
|
||||
%>
|
||||
<option value="<%=tty%>"<% if uci:get("network",ifname,"device") == tty then iffind = 1 %> selected="selected"<% end %>><%=tty%></option>
|
||||
<%
|
||||
end
|
||||
end
|
||||
if iffinf == 0 and uci:get("network",ifname,"device") ~= nil then
|
||||
%>
|
||||
|
|
Loading…
Reference in a new issue