mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
sync (#410)
This commit is contained in:
commit
540732c5af
5 changed files with 14 additions and 7 deletions
|
@ -2,6 +2,8 @@
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
. /lib/functions/network.sh
|
. /lib/functions/network.sh
|
||||||
|
|
||||||
|
[ -n "$(pgrep -f 'omr-schedule')" ] && exit 0
|
||||||
|
|
||||||
for schedule_bin in /usr/share/omr/schedule.d/*; do
|
for schedule_bin in /usr/share/omr/schedule.d/*; do
|
||||||
[ -x "$schedule_bin" ] && (
|
[ -x "$schedule_bin" ] && (
|
||||||
_log() {
|
_log() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ ! -f /etc/crontabs/root ] || [ "$(cat /etc/crontabs/root | grep omr-schedule)" = "" ]; then
|
if [ ! -f /etc/crontabs/root ] || [ "$(cat /etc/crontabs/root | grep omr-schedule)" = "" ]; then
|
||||||
echo "*/5 * * * * /bin/omr-schedule" >> /etc/crontabs/root
|
echo "* * * * * /bin/omr-schedule" >> /etc/crontabs/root
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -271,7 +271,7 @@ while true; do
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n "$OMR_TRACKER_DEVICE" ] && [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
|
if [ -n "$OMR_TRACKER_DEVICE" ] && [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
|
||||||
if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep 'state UP')" ]; then
|
if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep 'state UP')" ] || [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep 'state UNKNOWN')" ]; then
|
||||||
# retrieve iface ip and gateway
|
# retrieve iface ip and gateway
|
||||||
if ([ "$OMR_TRACKER_FAMILY" = "ipv4" ] || [ "$OMR_TRACKER_FAMILY" = "ipv4ipv6" ]) && [ "$OMR_TRACKER_INTERFACE_PROTO" != "dhcpv6" ]; then
|
if ([ "$OMR_TRACKER_FAMILY" = "ipv4" ] || [ "$OMR_TRACKER_FAMILY" = "ipv4ipv6" ]) && [ "$OMR_TRACKER_INTERFACE_PROTO" != "dhcpv6" ]; then
|
||||||
OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}')
|
OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}')
|
||||||
|
@ -445,7 +445,7 @@ while true; do
|
||||||
OMR_TRACKER_HOSTS="${OMR_TRACKER_HOSTS#* } $OMR_TRACKER_HOST"
|
OMR_TRACKER_HOSTS="${OMR_TRACKER_HOSTS#* } $OMR_TRACKER_HOST"
|
||||||
}
|
}
|
||||||
#OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
|
#OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
|
||||||
sleep "$OMR_TRACKER_INTERVAL_TRIES"
|
sleep "${OMR_TRACKER_INTERVAL_TRIES:-1}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
#if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
|
#if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "0" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
|
||||||
|
@ -550,7 +550,7 @@ while true; do
|
||||||
OMR_TRACKER_HOSTS6="${OMR_TRACKER_HOSTS6#* } $OMR_TRACKER_HOST6"
|
OMR_TRACKER_HOSTS6="${OMR_TRACKER_HOSTS6#* } $OMR_TRACKER_HOST6"
|
||||||
}
|
}
|
||||||
#OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
|
#OMR_TRACKER_TIMEOUT=$((OMR_TRACKER_TIMEOUT * 2))
|
||||||
sleep "$OMR_TRACKER_INTERVAL_TRIES"
|
sleep "${OMR_TRACKER_INTERVAL_TRIES:-1}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ -z "$OMR_TRACKER_DEVICE_IP" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ -z "$OMR_TRACKER_DEVICE_IP6" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
|
if [ -z "$OMR_TRACKER_DEVICE_IP" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ -z "$OMR_TRACKER_DEVICE_IP6" ] || [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then
|
||||||
|
@ -611,8 +611,8 @@ while true; do
|
||||||
_restart
|
_restart
|
||||||
|
|
||||||
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
|
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
|
||||||
sleep "$OMR_TRACKER_FAILURE_INTERVAL"
|
sleep "${$OMR_TRACKER_FAILURE_INTERVAL:-5}"
|
||||||
else
|
else
|
||||||
sleep "$OMR_TRACKER_INTERVAL"
|
sleep "${OMR_TRACKER_INTERVAL:-2}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -98,6 +98,7 @@ _launch_tracker() {
|
||||||
ifstatus=$(ifstatus "$1" | jsonfilter -q -e '@["up"]')
|
ifstatus=$(ifstatus "$1" | jsonfilter -q -e '@["up"]')
|
||||||
ifdevice=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
|
ifdevice=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
|
||||||
#[ "${ifstatus}" = "false" ] && [ -z "${ifdevice}" ] && return
|
#[ "${ifstatus}" = "false" ] && [ -z "${ifdevice}" ] && return
|
||||||
|
[ -z "${interval}" ] && interval=2
|
||||||
[ -z "${interval_tries}" ] && interval_tries=1
|
[ -z "${interval_tries}" ] && interval_tries=1
|
||||||
[ -z "${count}" ] && count=2
|
[ -z "${count}" ] && count=2
|
||||||
[ -z "${max_ttl}" ] && max_ttl=60
|
[ -z "${max_ttl}" ] && max_ttl=60
|
||||||
|
@ -105,6 +106,7 @@ _launch_tracker() {
|
||||||
[ -z "${check_quality}" ] && check_quality=0
|
[ -z "${check_quality}" ] && check_quality=0
|
||||||
[ -z "${tries}" ] && tries=5
|
[ -z "${tries}" ] && tries=5
|
||||||
[ -z "${tries_up}" ] && tries_up=${tries}
|
[ -z "${tries_up}" ] && tries_up=${tries}
|
||||||
|
[ -z "${failure_interval}" ] && failure_interval=5
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
|
|
@ -87,7 +87,10 @@ MY_DEPENDS := \
|
||||||
(TARGET_x86||TARGET_x86_64):kmod-mlx4-core \
|
(TARGET_x86||TARGET_x86_64):kmod-mlx4-core \
|
||||||
!(TARGET_ips40xx||TARGET_ramips):iptables-mod-ndpi !(TARGET_ips40xx||TARGET_ramips):kmod-ipt-ndpi libip4tc libip6tc \
|
!(TARGET_ips40xx||TARGET_ramips):iptables-mod-ndpi !(TARGET_ips40xx||TARGET_ramips):kmod-ipt-ndpi libip4tc libip6tc \
|
||||||
xray-core LINUX_5_4:xray-config !LINUX_5_4:xray-config-nft shadowsocks-rust-sslocal shadowsocks-rust-ssservice LINUX_5_4:shadowsocks-rust-config !LINUX_5_4:shadowsocks-rust-config-nft luci-app-shadowsocks-rust (LINUX_5_4&&(TARGET_x86_64||aarch64)):kmod-tcp-bbr2 kmod-ovpn-dco-v2 \
|
xray-core LINUX_5_4:xray-config !LINUX_5_4:xray-config-nft shadowsocks-rust-sslocal shadowsocks-rust-ssservice LINUX_5_4:shadowsocks-rust-config !LINUX_5_4:shadowsocks-rust-config-nft luci-app-shadowsocks-rust (LINUX_5_4&&(TARGET_x86_64||aarch64)):kmod-tcp-bbr2 kmod-ovpn-dco-v2 \
|
||||||
(TARGET_x86||TARGET_x86_64):luci-app-keepalived luci-proto-external omr-schedule
|
luci-proto-external omr-schedule
|
||||||
|
|
||||||
|
# keepalived disabled by default because it's running even with no configuration, would need a default OMR config with some changes
|
||||||
|
(TARGET_x86||TARGET_x86_64):keepalived (TARGET_x86||TARGET_x86_64):keepalived-sync
|
||||||
|
|
||||||
|
|
||||||
# !TARGET_mvebu:kmod-usb-net-smsc75xx
|
# !TARGET_mvebu:kmod-usb-net-smsc75xx
|
||||||
|
|
Loading…
Reference in a new issue