Skip to content

Commit

Permalink
mwan3: Add support for nslookup track method
Browse files Browse the repository at this point in the history
Also, a couple of small fixes for the nping method.

Signed-off-by: Brian J. Murrell <[email protected]>
  • Loading branch information
brianjmurrell committed Jan 8, 2025
1 parent fb3f438 commit 9c9023c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/mwan3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=mwan3
PKG_VERSION:=2.11.16
PKG_VERSION:=2.11.17
PKG_RELEASE:=5
PKG_MAINTAINER:=Florian Eckert <[email protected]>, \
Aaron Goodman <[email protected]>
Expand Down
14 changes: 13 additions & 1 deletion net/mwan3/files/usr/sbin/mwan3track
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ validate_track_method() {
return 1
}
;;
nslookup)
command -v nslookup 1>/dev/null 2>&1 || {
LOG warn "Missing nslookup. Please install busybox package."
return 1
}
;;
*)
LOG warn "Unsupported tracking method: $track_method"
return 2
Expand Down Expand Up @@ -322,11 +328,17 @@ main() {
fi
;;
nping-*)
WRAP nping -c $count $track_ip --${FAMILY#nping-} > $TRACK_OUTPUT &
WRAP nping -${FAMILY#ipv} -c $count $track_ip --${track_method#nping-} > $TRACK_OUTPUT &
TRACK_PID=$!
wait $TRACK_PID
result=$(grep Lost $TRACK_OUTPUT | awk '{print $12}')
;;
nslookup)
WRAP nslookup www.google.com $track_ip > $TRACK_OUTPUT &
TRACK_PID=$!
wait $TRACK_PID
result=$?
;;
esac
do_log=""
if [ $check_quality -eq 0 ]; then
Expand Down

0 comments on commit 9c9023c

Please sign in to comment.