saturn-power/slurmSuspend
2024-12-08 18:00:07 +01:00

9 lines
309 B
Bash
Executable File

#!/bin/bash
hosts=$(scontrol show hostnames "$1")
logfile=/var/log/power_save.log
echo "$(date) Suspend invoked $0 $*" >>$logfile
for host in $hosts
do
sudo ssh -i /root/.ssh/maintenance -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -t maintenance@$host "sudo /sbin/shutdown"
done
exit 0