Created
November 7, 2016 08:51
-
-
Save xoner/ede1b970b982ebe601f87403e7356e0a to your computer and use it in GitHub Desktop.
Bash script that shuts down all the running machines in a kvm host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Shuts down all the machines that are currently running in a kvm host | |
for machine in $(virsh list | tail -n +3 | awk '{print $2}'); | |
do | |
echo "Sutting down $machine" | |
virsh shutdown $machine | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment