mwan3: Add support for nslookup track method
authorBrian J. Murrell <brian@interlinx.bc.ca>
Fri, 3 Jan 2025 20:54:13 +0000 (15:54 -0500)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Tue, 21 Jan 2025 09:33:42 +0000 (10:33 +0100)
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
net/mwan3/Makefile
net/mwan3/files/usr/sbin/mwan3track

index e3dda2141df008ddad502cf96621e0c04c07d932..1a8a5d3d4aacf6d476e1067880f91353cf9cc036 100644 (file)
@@ -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 <fe@dev.tdt.de>, \
                Aaron Goodman <aaronjg@alumni.stanford.edu>
index 5e574d35f86e533752aa1f9271e1c6a74c55c937..8876e7a61773412795b5d8181f223d8c92bde831 100755 (executable)
@@ -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
@@ -327,6 +333,12 @@ main() {
                                                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