I have a script that looks like this:
SERVER="RHT372 RHTl373 RHT374 RHTl375"
case $1 in
"stop")
for SERVER in $SERVER
do
echo "================================================"
echo Stopping $SERVER
ssh root@$SERVER /var/tmp/stopServer.sh server1
done
;;
How can I make the ssh wait for the command to finish then go to the next server and issue the same command?