mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Add interface to shadowsocks tracker
This commit is contained in:
parent
0387798d74
commit
f7b2096fa2
3 changed files with 34 additions and 4 deletions
|
@ -3,9 +3,39 @@ local sys = require "luci.sys"
|
|||
local ifaces = sys.net:devices()
|
||||
local m, s, o
|
||||
|
||||
m = Map("omr-tracker", translate("OMR-Tracker"), translate("OMR-Tracker detect when a connection is down and execute needed scripts"))
|
||||
m = Map("omr-tracker", translate("OMR-Tracker"))
|
||||
|
||||
s = m:section(TypedSection, "defaults", translate("Defaults Settings"))
|
||||
s = m:section(TypedSection, "shadowsocks", translate("ShadowSocks tracker Settings"), translate("Detect if ShadowSocks is down and stop traffic redirection over it"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enable"), translate("When tracker is disabled, connection failover is also disabled"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "timeout", translate("Timeout (s)"))
|
||||
o.placeholder = "1"
|
||||
o.default = "1"
|
||||
o.datatype = "range(1, 100)"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "tries", translate("Tries"))
|
||||
o.placeholder = "4"
|
||||
o.default = "4"
|
||||
o.datatype = "range(1, 10)"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "interval", translate("Retry interval (s)"))
|
||||
o.placeholder = "2"
|
||||
o.default = "2"
|
||||
o.datatype = "range(1, 100)"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(DynamicList, "hosts", translate("Hosts"))
|
||||
o.placeholder = "bing.com"
|
||||
o.default = { "bing.com", "google.com" }
|
||||
o.rmempty = false
|
||||
|
||||
|
||||
s = m:section(TypedSection, "defaults", translate("Defaults Settings"), translate("OMR-Tracker detect when a connection is down and execute needed scripts"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enable"), translate("When tracker is disabled, connection failover is also disabled"))
|
||||
|
|
|
@ -14,7 +14,7 @@ config defaults 'defaults'
|
|||
option type 'ping'
|
||||
option options ''
|
||||
|
||||
config defaults 'shadowsocks'
|
||||
config shadowsocks 'shadowsocks'
|
||||
option enabled '1'
|
||||
list hosts 'google.com'
|
||||
list hosts 'bing.com'
|
||||
|
|
|
@ -97,7 +97,7 @@ _launch_shadowsocks_tracker() {
|
|||
|
||||
[ "$1" = "tracker" ] || return
|
||||
|
||||
_validate_section "defaults" "shadowsocks"
|
||||
_validate_section "shadowsocks" "shadowsocks"
|
||||
|
||||
config_get local_port "$1" local_port
|
||||
local disabled
|
||||
|
|
Loading…
Reference in a new issue