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 | ||||
6 | |||||
7 | ndnping -c 25 /B &> logs/${LOGPREFIX}_ping_A.log | ||||
8 | |||||
9 | LOSS=$(sed -n 's/.*Packet Loss=\([^,]*\).*/\1/p' logs/${LOGPREFIX}_ping_A.log) | ||||
10 | MAXRTT=$(sed -n 's/Round Trip Time.* = (\([^)]*\).*/\1/p' logs/${LOGPREFIX}_ping_A.log | cut -d/ -f2) | ||||
11 | |||||
12 | [[ $LOSS == '0%' ]] && [[ $(echo $MAXRTT | sed 's/\..*//') -le 100 ]] | ||||
13 |