Hello all.
I have built a cluster of 9 Macs for computational chemistry and I need a shell script that I can use from one computer to all the rest to shutdown.
I have modified all of the Macs so that there is pass-wordless ssh. As well, I have modified each "visudo" file on each machine by adding the line
Quote:
%users localhost=/sbin/shutdown -h now
The computer names are as follows: G5-1, G5-2, G5-3, etc up to G5-9. There are also two named G4-1 and G4-2.
If I type in a terminal
Quote:
$ ssh -f G5-2 "sudo shutdown -h now"
then G5-2 will shutdown.
What I was wondering was is there a way to write a script that I can execute from the main machine (which is G5-1) that will send this line to all of the machines and then wait 2 minutes and shut itself down?
That is, the script would send the shutdown command to G5-2, G5-3, G5-4, G5-5, G5-6, G5-7, G5-8, G5-9, G4-1 and G4-2. Then wait 1 minute and then shut itself down.
Please help.
Thanks.