mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Merge branch 'test' into develop
This commit is contained in:
commit
6c9779312e
15 changed files with 325 additions and 116 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# Copyright (C) 2018-2021 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
|
||||
# Released under GPL 3. See LICENSE for the full terms.
|
||||
|
||||
START=5
|
||||
|
@ -66,7 +66,7 @@ omr_set_settings() {
|
|||
uci -q set openmptcprouter.$1=interface
|
||||
uci -q set openmptcprouter.$1.multipath="$multipath"
|
||||
config_get disable_ipv6 settings disable_ipv6 "0"
|
||||
if [ "$disable_ipv6" = "1" ] || [ "$1" != "omr6in4" ]; then
|
||||
if [ "$proto" != "dhcpv6" ] && ([ "$disable_ipv6" = "1" ] || [ "$1" != "omr6in4" ]); then
|
||||
uci -q set network.$1.ipv6=0
|
||||
else
|
||||
uci -q set network.$1.ipv6=1
|
||||
|
@ -78,6 +78,13 @@ omr_set_settings() {
|
|||
[ -z "$ifname" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
|
||||
if [ -n "$ifname" ]; then
|
||||
if [ "$proto" = "dhcpv6" ]; 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
|
||||
fi
|
||||
|
||||
if [ "$addlatency" = "0" ] && [ "$(tc qdisc show dev $ifname | grep delay)" != "" ]; then
|
||||
tc qdisc del dev ${ifname} root netem
|
||||
fi
|
||||
|
|
|
@ -1232,7 +1232,12 @@ function interfaces_status()
|
|||
if gateway ~= "" or gateway6 ~= "" then
|
||||
if uci:get("openmptcprouter", "settings", "disablegwping") ~= "1" and connectivity ~= "ERROR" then
|
||||
if gateway ~= "" then
|
||||
local gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'"))
|
||||
local gw_ping_test = ""
|
||||
if ifname ~= "" and ifname ~= nil then
|
||||
gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 -I " .. ifname .. " " .. gateway .. " | grep '100% packet loss'"))
|
||||
else
|
||||
gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'"))
|
||||
end
|
||||
if gw_ping_test ~= "" then
|
||||
gw_ping = "DOWN"
|
||||
if connectivity == "OK" then
|
||||
|
@ -1241,7 +1246,12 @@ function interfaces_status()
|
|||
end
|
||||
end
|
||||
if gateway6 ~= "" then
|
||||
local gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway6 .. " | grep '100% packet loss'"))
|
||||
local gw_ping6_test = ""
|
||||
if ifname ~= "" and ifname ~= nil then
|
||||
gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 -I " .. ifname .. " " .. gateway6 .. " | grep '100% packet loss'"))
|
||||
else
|
||||
gw_ping6_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway6 .. " | grep '100% packet loss'"))
|
||||
end
|
||||
if gw_ping6_test ~= "" then
|
||||
gw_ping6 = "DOWN"
|
||||
if connectivity == "OK" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue