15 lines
345 B
Bash
15 lines
345 B
Bash
VIRSH="virsh --connect qemu:///system"
|
|
read -p "" option
|
|
case "$option" in
|
|
up)
|
|
for i in $($VIRSH list --all --name --autostart); do $VIRSH start "$i"; done
|
|
;;
|
|
down)
|
|
for i in $($VIRSH list --state-running --name --autostart); do
|
|
$VIRSH shutdown "$i"
|
|
until $VIRSH domstate "$i" | grep shut; do
|
|
sleep 0.5
|
|
done
|
|
done
|
|
;;
|
|
esac
|