diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-05-08 13:52:21 +0200 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2018-09-24 10:20:35 +0200 |
commit | c9d8fceb63a425f19fc12bee7ee4191fad514b6e (patch) | |
tree | cfda3ab55d55261c972ce0c9eee82a9391d95032 /net/mwan3 | |
parent | 222b9f50f3c2e3087cc23fa1610b75b73ebfda69 (diff) |
net/mwan3: add ttl check
Add the additional optional ttl check to test the connection.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'net/mwan3')
-rwxr-xr-x | net/mwan3/files/usr/sbin/mwan3track | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track index 274a024cc..923bd7bfa 100755 --- a/net/mwan3/files/usr/sbin/mwan3track +++ b/net/mwan3/files/usr/sbin/mwan3track @@ -55,6 +55,7 @@ main() { local recovery_interval down up size local keep_failure_interval check_quality failure_latency local recovery_latency failure_loss recovery_loss + local max_ttl [ -z "$5" ] && echo "Error: should not be started manually" && exit 0 @@ -84,6 +85,7 @@ main() { config_get down $1 down 5 config_get up $1 up 5 config_get size $1 size 56 + config_get max_ttl $1 max_ttl 60 config_get failure_interval $1 failure_interval $interval config_get_bool keep_failure_interval $1 keep_failure_interval 0 config_get recovery_interval $1 recovery_interval $interval @@ -120,10 +122,10 @@ main() { case "$track_method" in ping) if [ $check_quality -eq 0 ]; then - ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip &> /dev/null + ping -I $DEVICE -c $count -W $timeout -s $size -t $max_ttl -q $track_ip &> /dev/null result=$? else - ping_result="$(ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip | tail -2)" + ping_result="$(ping -I $DEVICE -c $count -W $timeout -s $size -t $max_ttl -q $track_ip | tail -2)" loss="$(echo "$ping_result" | grep "packet loss" | cut -d "," -f3 | awk '{print $1}' | sed -e 's/%//')" if [ "$loss" -eq 100 ]; then latency=999999 |