|
Multiple ssh, shutdown and exit script
PROBLEM:
I need to ssh into multiple remote machines, send a shutdown command and exit. The remote servers will then run their own scripts to gracefully shutdown their applications before shutting down.
ONE: This is to be achieved without using public key authentication; this is being avoided as a security measure. (Not negotiable) :-)
TWO: Passwords are required.
SO FAR:
I wrote an expect script that ssh's into the remote server, and calls on a script. Trouble is the expect script on the "master" server waits for the remote script to complete before exiting,thus time is wasted (I am trying to shut down several servers within a certain time).
Is there a way to run multiple instances of my expect script simultaneously, or /and is there another way to do this. If sequentially, then in the shortest time possible.
Thanks!!!
|