From 7acb0c3e389401974530ed04506ba56db36f2248 Mon Sep 17 00:00:00 2001 From: Michael Stoll Date: Tue, 4 Dec 2018 14:47:26 +0100 Subject: [PATCH] mwan3: add nping to tracking method Signed-off-by: Michael Stoll --- net/mwan3/Makefile | 2 +- net/mwan3/files/usr/sbin/mwan3track | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index b3ea84d90..23748eab9 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwan3 -PKG_VERSION:=2.7.6 +PKG_VERSION:=2.7.7 PKG_RELEASE:=1 PKG_MAINTAINER:=Florian Eckert PKG_LICENSE:=GPLv2 diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track index 420878472..f268f90b2 100755 --- a/net/mwan3/files/usr/sbin/mwan3track +++ b/net/mwan3/files/usr/sbin/mwan3track @@ -43,6 +43,12 @@ validate_track_method() { return 1 } ;; + nping-*) + which nping 1>/dev/null 2>&1 || { + $LOG warn "Missing nping. Please install nping package." + return 1 + } + ;; *) $LOG warn "Unsupported tracking method: $track_method" return 2 @@ -146,6 +152,18 @@ main() { httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null result=$? ;; + nping-tcp) + result=$(nping -e $DEVICE -c $count $track_ip --tcp | grep Lost | awk '{print $12}') + ;; + nping-udp) + result=$(nping -e $DEVICE -c $count $track_ip --udp | grep Lost | awk '{print $12}') + ;; + nping-icmp) + result=$(nping -e $DEVICE -c $count $track_ip --icmp | grep Lost | awk '{print $12}') + ;; + nping-arp) + result=$(nping -e $DEVICE -c $count $track_ip --arp | grep Lost | awk '{print $12}') + ;; esac if [ $check_quality -eq 0 ]; then if [ $result -eq 0 ]; then