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

Merge pull request #125 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-04-24 10:28:33 +08:00 committed by GitHub
commit 21659a31ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View file

@ -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="{&#34;path&#34;:{&#34;resource&#34;:&#34;\/luci-static\/resources&#34;,&#34;browser&#34;:&#34;\/cgi-bin\/luci\/admin\/filebrowser&#34;}}"></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
%>

View file

@ -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