Browse Source

Merge pull request #7738 from TDT-AG/pr/20181220-mwan3

mwan3: add nping to tracking method
lilik-openwrt-22.03
champtar 6 years ago
committed by GitHub
parent
commit
2a171c36fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions
  1. +1
    -1
      net/mwan3/Makefile
  2. +18
    -0
      net/mwan3/files/usr/sbin/mwan3track

+ 1
- 1
net/mwan3/Makefile View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3 PKG_NAME:=mwan3
PKG_VERSION:=2.7.6
PKG_VERSION:=2.7.7
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de> PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
PKG_LICENSE:=GPLv2 PKG_LICENSE:=GPLv2


+ 18
- 0
net/mwan3/files/usr/sbin/mwan3track View File

@ -43,6 +43,12 @@ validate_track_method() {
return 1 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" $LOG warn "Unsupported tracking method: $track_method"
return 2 return 2
@ -146,6 +152,18 @@ main() {
httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null
result=$? 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 esac
if [ $check_quality -eq 0 ]; then if [ $check_quality -eq 0 ]; then
if [ $result -eq 0 ]; then if [ $result -eq 0 ]; then


Loading…
Cancel
Save