blob: 17a7af3924440e410cca6f358d2fb86bb3ea1ae5 [file] [log] [blame]
Junxiao Shi2feae5b2014-06-19 02:40:22 -06001#!/bin/bash
2DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3source ../multi-host.conf
4
5LOGPREFIX=$1
Eric Newberry6fc88222015-06-19 10:43:24 -07006STRATEGY=$2
Junxiao Shi2feae5b2014-06-19 02:40:22 -06007
8ndnping -c 25 /B &> logs/${LOGPREFIX}_ping_A.log
9
Eric Newberry86b00b92015-06-07 15:23:51 -070010LOSS=$(sed -n 's/.*received, \([^,]*\) packet loss.*/\1/p' logs/${LOGPREFIX}_ping_A.log)
11MAXRTT=$(sed -n 's/rtt.* = .*\/\([^)]*\).*\/.*/\1/p' logs/${LOGPREFIX}_ping_A.log)
Junxiao Shi2feae5b2014-06-19 02:40:22 -060012
13[[ $LOSS == '0%' ]] && [[ $(echo $MAXRTT | sed 's/\..*//') -le 100 ]]
14