1
0
Fork 0
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:
suyuan 2021-02-16 10:13:09 +08:00
commit 7674697c1e
13 changed files with 61 additions and 9 deletions

View file

@ -241,6 +241,12 @@ while true; do
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then
OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}\"].nexthop" | tr -d "\n")
fi
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then
OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}/64\"].nexthop" | tr -d "\n")
fi
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then
OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}/56\"].nexthop" | tr -d "\n")
fi
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then
OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n")
fi

View file

@ -16,13 +16,21 @@ config defaults 'defaults'
list hosts '199.85.126.30'
list hosts '119.29.29.29'
list hosts '182.254.118.118'
option timeout '10'
option tries '3'
option interval '2'
option interval_tries '1'
option type 'ping'
option wait_test '0'
option options ''
ist hosts6 '2400:3200::1 2400:3200:baba::1'
ist hosts6 '2400:da00::6666'
ist hosts6 '2606:4700:4700::1111'
list hosts6 '2606:4700:4700::1001'
list hosts6 '2620:fe::fe'
list hosts6 '2620:fe::9'
list hosts6 '2001:4860:4860::8888'
list hosts6 '2001:4860:4860::8844'
option timeout '10'
option tries '3'
option interval '2'
option interval_tries '1'
option type 'ping'
option wait_test '0'
option options ''
config proxy 'proxy'
option enabled '1'

View file

@ -54,6 +54,7 @@ _launch_tracker() {
ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
[ -z "$ifname" ] && ifname=$(ifstatus "$1_4" | jsonfilter -q -e '@["l3_device"]')
[ -z "$ifname" ] && config_get ifname "$1" ifname
[ -n "$(echo $ifname | grep '@')" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
config_get multipath "$1" multipath
config_get ifenabled "$1" auto

View file

@ -60,6 +60,18 @@ if [ "$(uci -q get omr-tracker.proxy.hosts | grep '103.224.182.242')" != "" ]; t
EOF
fi
if [ -z "$(uci -q get omr-tracker.defaults.hosts6)" ]; then
uci -q batch <<-EOF >/dev/null
add_list omr-tracker.defaults.hosts6='2606:4700:4700::1111'
add_list omr-tracker.defaults.hosts6='2606:4700:4700::1001'
add_list omr-tracker.defaults.hosts6='2620:fe::fe'
add_list omr-tracker.defaults.hosts6='2620:fe::9'
add_list omr-tracker.defaults.hosts6='2001:4860:4860::8888'
add_list omr-tracker.defaults.hosts6='2001:4860:4860::8844'
commit omr-tracker
EOF
fi
if [ "$(uci -q get omr-tracker.defaults.wait_test)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set omr-tracker.defaults.wait_test=1