mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
commit
21659a31ca
2 changed files with 13 additions and 8 deletions
|
@ -35,6 +35,17 @@
|
|||
return t
|
||||
end
|
||||
|
||||
alltty = {}
|
||||
iftty = luci.sys.exec("timeout 1 /usr/bin/mmcli -L")
|
||||
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
|
||||
modeminfo = luci.sys.exec("timeout 1 /usr/bin/mmcli -m " .. modemid .. " --output-keyvalue")
|
||||
tty = luci.util.trim(luci.sys.exec("echo '" .. modeminfo .. "' | grep 'modem.generic.device ' | awk -F': ' '{print $2}'"))
|
||||
table.insert(alltty, tty)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
%>
|
||||
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-18.243.49640-2f13420" data-strings="{"path":{"resource":"\/luci-static\/resources","browser":"\/cgi-bin\/luci\/admin\/filebrowser"}}"></script>
|
||||
|
@ -780,16 +791,10 @@
|
|||
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.device.modemmanager" name="cbid.network.<%=ifname%>.device.modemmanager" size="1">
|
||||
<%
|
||||
iffind=0
|
||||
iftty = luci.sys.exec("/usr/bin/mmcli -L")
|
||||
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
|
||||
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}'"))
|
||||
for _, tty in ipairs(alltty) do
|
||||
%>
|
||||
<option value="<%=tty%>"<% if uci:get("network",ifname,"device") == tty then iffind = 1 %> selected="selected"<% end %>><%=tty%></option>
|
||||
<%
|
||||
end
|
||||
end
|
||||
if iffind == 0 and uci:get("network",ifname,"device") ~= nil then
|
||||
%>
|
||||
|
|
|
@ -137,7 +137,7 @@ if [ "$(uci -q get glorytun-udp.vpn.key)" = "" ] && [ "$(uci -q get glorytun.vpn
|
|||
set glorytun-udp.vpn.key=$(uci -q get glorytun.vpn.key)
|
||||
set glorytun-udp.vpn.host=$(uci -q get glorytun.vpn.host)
|
||||
EOF
|
||||
if [ "$(uci -q get glorytun-udp.vpn.proto)" = "udp" ]; then
|
||||
if [ "$(uci -q get glorytun.vpn.proto)" = "udp" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set glorytun-udp.vpn.enable=1
|
||||
set glorytun.vpn.enable=0
|
||||
|
|
Loading…
Reference in a new issue