mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
mwan3: add nping to tracking method
Signed-off-by: Michael Stoll <michael.stoll@meadow-robotics.com>
This commit is contained in:
committed by
Florian Eckert
parent
440829b6b9
commit
7acb0c3e38
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user