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 #97 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-03-30 22:20:52 +08:00 committed by GitHub
commit e6a4c9c67e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -20,4 +20,5 @@ uci show | \
-e "/vless_address=/s/......$/xxxxxx'/" \
-e "/vpn\.key=/s/......$/xxxxxx'/" \
-e "/vps\.key=/s/......$/xxxxxx'/" \
-e "/wgkey=/s/......$/xxxxxx'/" \
-e "/token=/s/............$/xxxxxx'/"

View file

@ -60,6 +60,7 @@ omr_set_settings() {
config_get device "$1" device
config_get proto "$1" proto
config_get type "$1" type
config_get ip6addr "$1" ip6addr
config_get ipv6 "$1" ipv6
config_get addlatency "$1" addlatency
[ -z "$multipath" ] || [ "$multipath" = "off" ] && return
@ -79,11 +80,15 @@ omr_set_settings() {
[ -n "$(echo $ifname | grep '@')" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
if [ -n "$ifname" ]; then
if [ "$proto" = "dhcpv6" ] || [ "$ipv6" = "1" ]; then
if [ "$proto" = "dhcpv6" ] || [ "$ipv6" = "1" ] || [ -n "$ip6addr" ]; then
# Change interface name for sysctl in case of VLAN (eth0.2 => eth0/2)
ifnamesys=$(echo $ifname | sed 's:\.:/:')
sysctl -qw net.ipv6.conf.${ifnamesys}.disable_ipv6=0
sysctl -qw net.ipv6.conf.${ifnamesys}.accept_ra=1
[ -z "$ip6addr" ] && sysctl -qw net.ipv6.conf.${ifnamesys}.accept_ra=1
else
ifnamesys=$(echo $ifname | sed 's:\.:/:')
sysctl -qw net.ipv6.conf.${ifnamesys}.disable_ipv6=1
sysctl -qw net.ipv6.conf.${ifnamesys}.accept_ra=0
fi
if [ "$addlatency" = "0" ] && [ "$(tc qdisc show dev $ifname | grep delay)" != "" ]; then
@ -97,7 +102,6 @@ omr_set_settings() {
fi
fi
fi
}
start_service() {

View file

@ -26,6 +26,8 @@ export OMR_TRACKER_DEVICE_GATEWAY
export OMR_TRACKER_DEVICE_GATEWAY6
export OMR_TRACKER_IPV6
export OMR_TRACKER_PROTO
export OMR_TRACKER_INTERVAL_TRIES
export OMR_TRACKER_INTERVAL
dscp=56 # set DSCP CS7 (56) in outgoing packets
initial_hosts="$OMR_TRACKER_HOSTS"

View file

@ -75,7 +75,7 @@ while true; do
uci -q set openmptcprouter.omr.v2ray="up"
uci -q commit openmptcprouter.omr
}
if [ -z "$(iptables -t nat -L -n | grep v2r)" ]; then
if [ -z "$(iptables -w -t nat -L -n | grep v2r)" ]; then
_log "Reload V2Ray rules"
/etc/init.d/v2ray rules_up 2> /dev/null
_get_ip
@ -86,7 +86,7 @@ while true; do
last=$((last + 1 ))
[ -z "$nocontact" ] && nocontact="$host" || nocontact="$nocontact, $host"
[ "${last}" -ge "${retry}" ] && {
if [ -n "$(iptables -t nat -L -n | grep v2r)" ]; then
if [ -n "$(iptables -w -t nat -L -n | grep v2r)" ]; then
_log "V2Ray is down (can't contact via http ${nocontact})"
uci -q set openmptcprouter.omr.v2ray="down"
uci -q commit openmptcprouter.omr