Junxiao Shi | 2feae5b | 2014-06-19 02:40:22 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 3 | source ../multi-host.conf |
| 4 | |
| 5 | LOGPREFIX=$1 |
Eric Newberry | 6fc8822 | 2015-06-19 10:43:24 -0700 | [diff] [blame^] | 6 | STRATEGY=$2 |
Junxiao Shi | 2feae5b | 2014-06-19 02:40:22 -0600 | [diff] [blame] | 7 | |
| 8 | ndnping -c 25 /B &> logs/${LOGPREFIX}_ping_A.log |
| 9 | |
Eric Newberry | 86b00b9 | 2015-06-07 15:23:51 -0700 | [diff] [blame] | 10 | LOSS=$(sed -n 's/.*received, \([^,]*\) packet loss.*/\1/p' logs/${LOGPREFIX}_ping_A.log) |
| 11 | MAXRTT=$(sed -n 's/rtt.* = .*\/\([^)]*\).*\/.*/\1/p' logs/${LOGPREFIX}_ping_A.log) |
Junxiao Shi | 2feae5b | 2014-06-19 02:40:22 -0600 | [diff] [blame] | 12 | |
| 13 | [[ $LOSS == '0%' ]] && [[ $(echo $MAXRTT | sed 's/\..*//') -le 100 ]] |
| 14 | |