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

Merge pull request #93 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-03-27 21:12:44 +08:00 committed by GitHub
commit d6cf49f849
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 4 deletions

View file

@ -134,6 +134,13 @@ o.default = false
o.disabled = 0 o.disabled = 0
o.enabled = 1 o.enabled = 1
o = s:option(Flag, "restart_down", translate("Restart if down"), translate("Restart interface if detected as down"))
o.optional = false
o.rmempty = false
o.default = false
o.disabled = 0
o.enabled = 1
o = s:option(DynamicList, "hosts", translate("Hosts"), translate("Must be IPs and not domains")) o = s:option(DynamicList, "hosts", translate("Hosts"), translate("Must be IPs and not domains"))
o.placeholder = "4.2.2.1" o.placeholder = "4.2.2.1"
o.default = { "4.2.2.1", "8.8.8.8" } o.default = { "4.2.2.1", "8.8.8.8" }
@ -202,6 +209,13 @@ o.default = false
o.disabled = 0 o.disabled = 0
o.enabled = 1 o.enabled = 1
o = s:option(Flag, "restart_down", translate("Restart if down"), translate("Restart interface if detected as down"))
o.optional = false
o.rmempty = false
o.default = false
o.disabled = 0
o.enabled = 1
o = s:option(DynamicList, "hosts", translate("Hosts"), translate("Must be IPs and not domains")) o = s:option(DynamicList, "hosts", translate("Hosts"), translate("Must be IPs and not domains"))
o.placeholder = "4.2.2.1" o.placeholder = "4.2.2.1"
o.default = { "4.2.2.1", "8.8.8.8" } o.default = { "4.2.2.1", "8.8.8.8" }

View file

@ -428,7 +428,7 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
var whois = mArray.wans[i].whois; var whois = mArray.wans[i].whois;
var whois6 = mArray.wans[i].whois6; var whois6 = mArray.wans[i].whois6;
var signal = mArray.wans[i].signal; var signal = mArray.wans[i].signal;
var status = mArray.wans[i].status; var istatus = mArray.wans[i].status;
var multipath = mArray.wans[i].multipath; var multipath = mArray.wans[i].multipath;
if(multipath == 'master') if(multipath == 'master')
{ {
@ -570,12 +570,12 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
{ {
statusMessage += '<%:No Server http response after 1 second%>' + '<br />'; statusMessage += '<%:No Server http response after 1 second%>' + '<br />';
} }
if (status == 'ERROR' && ipaddr != '' && ipaddr == mArray.wans[i].gateway) if (istatus == 'ERROR' && ipaddr != '' && ipaddr == mArray.wans[i].gateway)
{ {
statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />'; statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />';
statusMessageClass = "error"; statusMessageClass = "error";
} }
if (status == 'ERROR' && ip6addr != '' && ip6addr == mArray.wans[i].gateway6) if (istatus == 'ERROR' && ip6addr != '' && ip6addr == mArray.wans[i].gateway6)
{ {
statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />'; statusMessage += '<%:Wan IP and gateway are identical%>' + '<br />';
statusMessageClass = "error"; statusMessageClass = "error";

View file

@ -678,6 +678,15 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
script_alert_down="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.script_alert_down)" script_alert_down="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.script_alert_down)"
[ -n "$script_alert_down" ] && eval $script_alert_down [ -n "$script_alert_down" ] && eval $script_alert_down
restart_down="$(uci -q get omr-tracker.$OMR_TRACKER_INTERFACE.restart_down)"
[ -z "$restart_down" ] && restart_down="$(uci -q get omr-tracker.defaults.restart_down)"
[ "$restart_down" = "1" ] && {
_log "Restart $OMR_TRACKER_INTERFACE"
ifdown $OMR_TRACKER_INTERFACE 2>&1 >/dev/null
sleep 5
ifup $OMR_TRACKER_INTERFACE 2>&1 >/dev/null
}
if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then if [ "$OMR_TRACKER_STATUS_MSG" = "" ]; then
_log "$OMR_TRACKER_INTERFACE down" _log "$OMR_TRACKER_INTERFACE down"

View file

@ -24,6 +24,7 @@ config defaults 'defaults'
option type 'ping' option type 'ping'
option wait_test '0' option wait_test '0'
option server_http_test '1' option server_http_test '1'
option restart_down '0'
option options '' option options ''
config proxy 'proxy' config proxy 'proxy'

View file

@ -1,2 +1,3 @@
net.netfilter.nf_conntrack_helper=1 net.netfilter.nf_conntrack_helper=1
net.ipv4.tcp_fack=1 net.ipv4.tcp_fack=1
net.core.fb_tunnels_only_for_init_net=1

View file

@ -19,7 +19,6 @@ PKG_SOURCE_VERSION:=6c0c5fb15851e13b36fe2eeaaba97fd27c9d291b
PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=golang/host
GO_PKG:=github.com/shadowsocks/v2ray-plugin GO_PKG:=github.com/shadowsocks/v2ray-plugin
#GO_PKG_BUILD_PKG:=github.com/shadowsocks/v2ray-plugin #GO_PKG_BUILD_PKG:=github.com/shadowsocks/v2ray-plugin