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

sync
This commit is contained in:
suyuan 2022-02-11 23:30:37 +08:00 committed by GitHub
commit 68b2b1e0b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 37 deletions

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iperf
PKG_VERSION:=3.10.1
PKG_VERSION:=3.11
PKG_RELEASE:=10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf
PKG_HASH:=03bc9760cc54a245191d46bfc8edaf8a4750f0e87abca6764486972044d6715a
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/esnet/iperf/archive/refs/tags/
PKG_HASH:=96e909c0d3ab6034c52328c2954fb3934aaff349395c4bc2611dcd50e6b89875
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-3-Clause

View file

@ -14,13 +14,18 @@ _add_proto() {
if [ "$(dd if=/proc/net/xt_ndpi/proto bs=4096 2> /dev/null | grep $protoname)" = "" ]; then
echo "add_custom $protoname" >/proc/net/xt_ndpi/proto
fi
allurls="$(dd if=/proc/net/xt_ndpi/host_proto bs=4096 2> /dev/null)"
hosts="$( uci -q get omr-bypass.$protoname.url )"
for url in $hosts; do
echo "$protoname:$url" >/proc/net/xt_ndpi/host_proto
if [ "$(echo "$allurls" | grep -i ^${protoname}: | grep $url)" = "" ]; then
echo "$protoname:$url" >/proc/net/xt_ndpi/host_proto
fi
done
ip="$( uci -q get omr-bypass.$protoname.ip )"
for ip in $ips; do
echo "$protoname:$ip" >/proc/net/xt_ndpi/ip_proto
if [ "$(echo "$allurls" | grep -i ^${protoname}: | grep $ip)" = "" ]; then
echo "$protoname:$ip" >/proc/net/xt_ndpi/ip_proto
fi
done
}

View file

@ -664,7 +664,7 @@ disable_pihole() {
commit dhcp
EOF
fi
/etc/init.d/dnsmasq restart
/etc/init.d/dnsmasq restart 2>&1 >/dev/null
fi
}
@ -746,7 +746,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
commit openvpn
EOF
fi
/etc/init.d/openvpn restart $VPN_BASE_INTF
/etc/init.d/openvpn restart $VPN_BASE_INTF 2>&1 >/dev/null
fi
config_load openmptcprouter
config_foreach del_server_route server
@ -824,25 +824,25 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
_log "Tunnel down use ShadowSocks for UDP"
uci -q set shadowsocks-libev.ss_rules.redir_udp='hi1'
if /etc/init.d/shadowsocks-libev rules_exist ; then
/etc/init.d/shadowsocks-libev rules_down
/etc/init.d/shadowsocks-libev rules_up
/etc/init.d/shadowsocks-libev rules_down 2>&1 >/dev/null
/etc/init.d/shadowsocks-libev rules_up 2>&1 >/dev/null
fi
fi
if [ "$(uci -q get dsvpn.vpn.enable)" = "1" ]; then
_log "DSVPN down, restart it"
/etc/init.d/dsvpn restart
/etc/init.d/dsvpn restart 2>&1 >/dev/null
fi
if [ "$(uci -q get mlvpn.general.enable)" = "1" ]; then
_log "MLVPN down, restart it"
/etc/init.d/mlvpn restart
/etc/init.d/mlvpn restart 2>&1 >/dev/null
fi
if [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then
_log "Glorytun VPN down, restart it"
/etc/init.d/glorytun restart
/etc/init.d/glorytun restart 2>&1 >/dev/null
fi
if [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then
_log "Glorytun UDP VPN down, restart it"
/etc/init.d/glorytun-udp restart
/etc/init.d/glorytun-udp restart 2>&1 >/dev/null
fi
config_load openmptcprouter
config_foreach disable_pihole server
@ -935,7 +935,7 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
config_load openmptcprouter
config_foreach enable_pihole server
#config_foreach delete_server_default_route server
[ "$nbserver" = "$piholeenabled" ] && /etc/init.d/openmptcprouter-vps set_pihole
[ "$nbserver" = "$piholeenabled" ] && /etc/init.d/openmptcprouter-vps set_pihole 2>&1 >/dev/null
#ubus call network reload
exit 0
fi
@ -1219,7 +1219,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
_log "New public ip detected for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE): $ipaddr"
/etc/init.d/mptcp enabled && {
_log "Reload MPTCP for $OMR_TRACKER_DEVICE"
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" >/dev/null
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" 2>&1 >/dev/null
}
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ipaddr"
}
@ -1323,7 +1323,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
_log "New public ip detected for $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE): $ip6addr"
/etc/init.d/mptcp enabled && {
_log "Reload MPTCP for $OMR_TRACKER_DEVICE"
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" >/dev/null
/etc/init.d/mptcp reload "$OMR_TRACKER_DEVICE" 2>&1 >/dev/null
}
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.publicip="$ip6addr"
}
@ -1421,7 +1421,7 @@ fi
masterintf="$(uci -q show openmptcprouter | grep -m 1 multipath=\'master\' | cut -d'.' -f2)"
[ -z "$masterintf" ] && masterintf="$(uci -q show network | grep -m 1 multipath=\'master\' | cut -d'.' -f2)"
masterlatency="$(uci -q get openmptcprouter.$masterintf.latency | tr -d '\n')"
if [ -z "$masterlatency" ] || ([ -n "$masterintf" ] &&[ "$(uci -q get openmptcprouter.$masterintf.state)" = "down" ]); then
if [ -z "$masterlatency" ] || ([ -n "$masterintf" ] && [ "$(uci -q get openmptcprouter.$masterintf.state)" = "down" ]); then
masterlatency=1000
fi
if [ -n "$masterintf" ] && ([ "$masterlatency" != "" ] || [ "$(uci -q get openmptcprouter.$masterintf.state)" = "down" ]); then
@ -1449,22 +1449,22 @@ fi
# If a service is down, force restart it
if [ "$(pgrep ss-redir)" = "" ] && [ "$(pgrep ss-local)" = "" ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "192.18.1.3" ] && [ "$(uci -q get shadowsocks-libev.sss0.key)" != "" ]; then
_log "Can't find Shadowsocks, restart it..."
/etc/init.d/shadowsocks-libev restart
/etc/init.d/shadowsocks-libev restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep glorytun)" = "" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ] && [ -f /etc/init.d/glorytun ] && [ "$(uci -q get glorytun.vpn.key)" != "" ]; then
_log "Can't find Glorytun, restart it..."
/etc/init.d/glorytun restart
/etc/init.d/glorytun restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep glorytun-udp)" = "" ] && [ "$(uci -q get glorytun-usp.vpn.enable)" = "1" ] && [ -f /etc/init.d/glorytun-udp ] && [ "$(uci -q get glorytun-udp.vpn.key)" != "" ]; then
_log "Can't find Glorytun UDP, restart it..."
/etc/init.d/glorytun-udp restart
/etc/init.d/glorytun-udp restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep unbound)" = "" ] && [ -f /etc/init.d/unbound ] && [ "$(uci -q get unbound.@unbound[0].enabled)" = "1" ]; then
/etc/init.d/unbound restart
/etc/init.d/unbound restart 2>&1 >/dev/null
sleep 5
fi
@ -1477,53 +1477,53 @@ if [ "$(pgrep openvpn)" = "" ] && [ -f /etc/init.d/openvpn ]; then
config_foreach openvpn_enabled openvpn
if [ "$openvpn_enable" = "1" ]; then
_log "Can't find OpenVPN, restart it"
/etc/init.d/openvpn restart
/etc/init.d/openvpn restart 2>&1 >/dev/null
sleep 5
fi
fi
if [ "$(pgrep mlvpn)" = "" ] && [ "$(uci -q get mlvpn.general.enable)" = "1" ] && [ -f /etc/init.d/mlvpn ] && [ "$(uci -q get mlvpn.general.password)" != "" ]; then
_log "Can't find MLVPN, restart it..."
/etc/init.d/mlvpn restart
/etc/init.d/mlvpn restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep dsvpn)" = "" ] && [ "$(uci -q get dsvpn.vpn.enable)" = "1" ] && [ -f /etc/init.d/dsvpn ] && [ "$(uci -q get dsvpn.vpn.key)" != "" ]; then
_log "Can't find DSVPN, restart it..."
/etc/init.d/dsvpn restart
/etc/init.d/dsvpn restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep v2ray)" = "" ] && [ "$(uci -q get v2ray.main.enabled)" = "1" ] && [ -f /etc/init.d/v2ray ]; then
_log "Can't find V2Ray, restart it..."
/etc/init.d/v2ray restart
/etc/init.d/v2ray restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep miniupnpd)" = "" ] && [ "$(uci -q get upnpd.config.enabled)" = "1" ] && [ -f /etc/init.d/miniupnpd ]; then
_log "Can't find miniupnpd, restart it..."
/etc/init.d/miniupnpd restart
/etc/init.d/miniupnpd restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep rpcd)" = "" ] && [ -f /etc/init.d/rpcd ]; then
_log "Can't find rpcd, restart it..."
/etc/init.d/rpcd restart
/etc/init.d/rpcd restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep uhttpd)" = "" ] && [ -f /etc/init.d/uhttpd ]; then
_log "Can't find uhttpd, restart it..."
/etc/init.d/uhttpd restart
/etc/init.d/uhttpd restart 2>&1 >/dev/null
sleep 5
fi
#if [ "$(pgrep ModemManager)" = "" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(uci -q show network | grep modemmanager)" ] && [ "$(uci -q get openmptcprouter.settings.modemmanager)" != "0" ]; then
# _log "Can't find ModemManager, restart it..."
# /etc/init.d/modemmanager restart
# /etc/init.d/modemmanager restart 2>&1 >/dev/null
# sleep 5
#fi
if [ "$(uci -q get v2ray.main.enabled)" = "1" ] && [ -f /etc/init.d/v2ray ] && [ "$(pgrep -f omr-tracker-v2ray)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-v2ray, restart omr-tracker..."
/etc/init.d/omr-tracker restart
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
fi
set_get_config() {
@ -1539,7 +1539,7 @@ fi
if [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-libev.sss0.key)" != "" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "192.18.1.3" ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-ss, restart omr-tracker..."
/etc/init.d/omr-tracker restart
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
fi
if [ "$(uci -q get glorytun.vpn.enable)" = "1" ] && [ "$(uci -q get glorytun.vpn.key)" = "" ]; then
@ -1563,12 +1563,12 @@ fi
if [ "$(iptables-save | grep omr-bypass)" = "" ] && [ "$(pgrep omr-bypass)" = "" ]; then
_log "Can't find omr-bypass rules, restart omr-bypass..."
/etc/init.d/omr-bypass
/etc/init.d/omr-bypass 2>&1 >/dev/null
fi
if [ -f /etc/backup/installed_packages.txt ]; then
_log "Reinstall packages..."
/etc/init.d/sysupgrade restart
/etc/init.d/sysupgrade restart 2>&1 >/dev/null
fi
if [ "$(pgrep openmptcprouter-vps)" = "" ] && ([ "$(uci -q show openmptcprouter | grep get_config=\'1\')" != "" ] || [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" != "" ]); then

View file

@ -11,8 +11,8 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ndpi-netfilter2
PKG_RELEASE:=3
PKG_REV:=25a5c2e1d619aa2d819b18bed8276b3bd7eb4c5b
PKG_VERSION:=3.2-$(PKG_REV)
PKG_REV:=59f295ba86110f2642f76eb967b041c4108fedd5
PKG_VERSION:=4-$(PKG_REV)
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2

View file

@ -85,7 +85,11 @@ _post_tracking() {
_log() {
logger -t "post-tracking-${tracker_bin##*/}" "$*"
}
. "$tracker_bin"
tmp=$(mktemp)
. "$tracker_bin" 2>&1 > "$tmp"
trackresult=$(< "$tmp")
[ -n "$trackresult" ] && _log $trackresult
rm -f "$tmp"
)
done
}