jeudi 15 octobre 2015

script to connect servers and run some commands on amazon

I want to write a fish script to run Locust on the amazon servers. I wrote the code as below, the problem is that when the shell connects to first server it cant send the other commands there.

Any helps, recommedationa are appreciated.

set labs 'ubuntu@compute1.amazonaws.com' 'ubuntu@compute2.amazonaws.com' 'ubuntu@compute3.amazonaws.com' 'ubuntu@compute4.amazonaws.com' 
set key /Users/mesutgunes/Desktop/project-key.pem

for lab in $labs
    ssh -i $key $lab 
    cd /path/to/project/
    screen
    locust -f file.py --master
    exit
end




Aucun commentaire:

Enregistrer un commentaire