Created
January 7, 2015 19:11
-
-
Save caglar10ur/ef3ba21cc52ef519d68a to your computer and use it in GitHub Desktop.
iperf-servers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
base_port=5000 | |
# Command line input: number of servers | |
# E.g. 5 | |
num_servers=$1 | |
shift | |
# Command line input: base report file name | |
# E.g. report | |
report_base=$1 | |
shift | |
# Optional command line input: other iperf options | |
# E.g. -u | |
iperf_options="$*" | |
# Run iperf multiple times | |
for i in `seq 1 $num_servers`; do | |
# Set server port | |
server_port=$(($base_port+$i)); | |
# Report file includes server port | |
report_file=${report_base}-${server_port}.txt | |
# Run iperf | |
iperf -s -p $server_port $iperf_options &> $report_file & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment