Skip to content

Instantly share code, notes, and snippets.

@phunehehe
Created December 6, 2013 06:24
Show Gist options
  • Save phunehehe/7819413 to your computer and use it in GitHub Desktop.
Save phunehehe/7819413 to your computer and use it in GitHub Desktop.
for i in $(virsh list | grep running | awk '{print $2}')
do
virsh autostart $i
done
for i in $(virsh list --all | grep 'shut off' | awk '{print $2}')
do
virsh autostart --disable $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment