BashScripts.org
http://bashscripts.org/forum/

Bash script to run multiple instances of IPERF
http://bashscripts.org/forum/viewtopic.php?f=8&t=929
Page 1 of 1

Author:  zinc6824 [ Wed Nov 18, 2009 8:47 pm ]
Post subject:  Bash script to run multiple instances of IPERF

Hi All,

I am a newbie to writing bash scripts.

I need a bash script that can run multiple instances of iperf in client or server mode all in separate windows. i am currently launching each command in separate terminal window.

e.g.

iperf -c 10.10.10.1 -u -p 5001
iperf -c 10.10.10.2 -u -p 5002
iperf -c 10.10.10.3 -u -p 5003

Thanks for your help.

- Zinc

Author:  fredrik.eriksson [ Thu Nov 19, 2009 2:03 am ]
Post subject:  Re: Bash script to run multiple instances of IPERF

If your ip's are sequential and same with ports then this is a quite easy feat to accomplish.

Code:
#!/bin/bash
for i in $(seq 1 $1); do
   iperf -c 10.10.10.$i -u -p 500$i
done

usage: ./script.sh [number of servers to start]

Best regards
Fredrik Eriksson

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group • http://www.phpbb.com