diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-06-28 14:40:20 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2024-06-28 14:40:20 +0200 |
commit | 1fe26886490f0b66c2611db7d45a80288b141d1d (patch) | |
tree | b57aa73651391b170b5d0ed3c8d10cb293d00c24 /libvirt-cleanup.sh | |
download | ipxe-tests-1fe26886490f0b66c2611db7d45a80288b141d1d.tar.gz |
initial commit
Diffstat (limited to 'libvirt-cleanup.sh')
-rw-r--r-- | libvirt-cleanup.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libvirt-cleanup.sh b/libvirt-cleanup.sh new file mode 100644 index 0000000..5166f2b --- /dev/null +++ b/libvirt-cleanup.sh @@ -0,0 +1,18 @@ +#!/bin/sh +arch="$(uname -m)" +domains="$(virsh list --all --name | grep test-ipxe-ipv.-${arch})" +networks="$(virsh net-list --all --name | grep test-ipxe-ipv.-${arch})" + +for domain in $domains; do + if virsh list --name | grep -q $domain; then + virsh destroy $domain + fi + virsh undefine --nvram $domain +done + +for network in $networks; do + if virsh net-list --name | grep -q $domain; then + virsh net-destroy $network + fi + virsh net-undefine $network +done |