Register
It is currently Sun Nov 23, 2014 8:47 pm

Bash script to run multiple instances of IPERF


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Wed Nov 18, 2009 8:47 pm   

Joined: Wed Nov 18, 2009 8:42 pm
Posts: 1
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


Top
 Profile  
 PostPosted: Thu Nov 19, 2009 2:03 am   

Joined: Mon Nov 17, 2008 7:25 am
Posts: 221
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


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP