Skip to content

Instantly share code, notes, and snippets.

@rluisr
Last active October 7, 2016 05:07
Show Gist options
  • Save rluisr/6eda8d247c1cb442f73896bd1405370f to your computer and use it in GitHub Desktop.
Save rluisr/6eda8d247c1cb442f73896bd1405370f to your computer and use it in GitHub Desktop.
Shutdown All VMs. Using `virsh`.
#!/bin/bash -e
virsh list --all | egrep '実行中|running' | awk '{print $2}' | xargs -t -I {} virsh shutdown {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment