File: load.sh

package info (click to toggle)
atftp 0.7-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,176 kB
  • ctags: 544
  • sloc: ansic: 6,372; sh: 3,883; makefile: 80
file content (29 lines) | stat: -rwxr-xr-x 476 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

if [ $# -lt 1 ]; then
    echo "Usage: load.sh [host] [port]"
    exit 1
fi

TFTP=../atftp
HOST=$1
PORT=$2
FILE=linux
CONCURENT=40
TIMEOUT=80
LOOP=1
i=$LOOP
while [ $i -gt 0 ]; do
    echo -n "Loop $i "
    j=$CONCURENT
    while [ $j -gt 0 ]; do
	$TFTP --tftp-timeout 5 --timeout 10 --get -r $FILE -l /dev/null $HOST $PORT 2>$j.out&
	echo -n "."
	j=$[ $j - 1 ]
    done
    echo  " done"
    i=$[ $i - 1 ]
    if [ $i -gt 0 ]; then
  	sleep $TIMEOUT
    fi
done