diff options
Diffstat (limited to 'recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/pingsizes.sh')
-rwxr-xr-x | recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/pingsizes.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/pingsizes.sh b/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/pingsizes.sh new file mode 100755 index 0000000..faefb24 --- /dev/null +++ b/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/pingsizes.sh | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Usage: ./pingsizes.sh 1440 20 (or greater) | ||
4 | # | ||
5 | |||
6 | PINGDEST=${PINGDEST:-200.200.200.10} | ||
7 | k=$1 | ||
8 | lim="$((k+$2))" | ||
9 | ((k-=1)) | ||
10 | while [ "$k" != "$lim" ] ; do | ||
11 | echo -n "ping -s $((k+=1)) : " | ||
12 | ping -i 1000 -c 1 -s $k $PINGDEST | grep packets & | ||
13 | sleep 1 | ||
14 | PID=`ps -eaf | grep 'ping -i' | grep -v grep | sed 's/[ ][ ]*/ /g' | cut -d " " -f 2` | ||
15 | if [ -n "$PID" ] ; then | ||
16 | echo "****************** killing $PID" | ||
17 | kill $PID > /dev/null | ||
18 | fi | ||
19 | done | ||