mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix interface name and add multiple server support to omr-bypass
This commit is contained in:
parent
edff787f63
commit
cad1cb5a06
2 changed files with 11 additions and 4 deletions
|
@ -227,6 +227,12 @@ _bypass_ip_set() {
|
||||||
_bypass_ip $ip $interface
|
_bypass_ip $ip $interface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_bypass_omr_server() {
|
||||||
|
local ip
|
||||||
|
config_get ip $1 ip
|
||||||
|
_bypass_ip $ip
|
||||||
|
}
|
||||||
|
|
||||||
boot() {
|
boot() {
|
||||||
BOOT=1
|
BOOT=1
|
||||||
start "$@"
|
start "$@"
|
||||||
|
@ -262,6 +268,8 @@ start_service() {
|
||||||
config_foreach _intf_rule interface
|
config_foreach _intf_rule interface
|
||||||
|
|
||||||
local ndpi_rules=""
|
local ndpi_rules=""
|
||||||
|
config_load openmptcprouter
|
||||||
|
config_foreach _bypass_omr_server server
|
||||||
config_load omr-bypass
|
config_load omr-bypass
|
||||||
config_foreach _bypass_ip_set ips
|
config_foreach _bypass_ip_set ips
|
||||||
config_foreach _bypass_mac macs
|
config_foreach _bypass_mac macs
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
local net = require "luci.model.network".init()
|
local net = require "luci.model.network".init()
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local ifaces = sys.net:devices()
|
|
||||||
local m, s, o
|
local m, s, o
|
||||||
|
|
||||||
m = Map("omr-tracker", translate("OMR-Tracker"))
|
m = Map("omr-tracker", translate("OMR-Tracker"))
|
||||||
|
@ -86,9 +85,9 @@ s.template_addremove = "omr-tracker/cbi-select-add"
|
||||||
s.addremove = true
|
s.addremove = true
|
||||||
s.add_select_options = { }
|
s.add_select_options = { }
|
||||||
s.add_select_options[''] = ''
|
s.add_select_options[''] = ''
|
||||||
for _, iface in ipairs(ifaces) do
|
for _, iface in ipairs(net:get_networks()) do
|
||||||
if not (iface == "lo" or iface:match("^ifb.*")) then
|
if not (iface:name() == "loopback") then
|
||||||
s.add_select_options[iface] = iface
|
s.add_select_options[iface:name()] = iface:name()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue