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 #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() {