first try at creating VirtualizationInterface

This commit is contained in:
2020-05-10 18:59:30 -05:00
parent 7fe0d9a9c5
commit 426fad7b10
12 changed files with 395 additions and 22 deletions

View File

@ -0,0 +1,16 @@
#!/bin/sh
vmname="$1"
if echo "$vmname" | grep -vqE '^capsul-[a-z0-9]{10}$'; then
echo "vmname $vmname must match "'"^capsul-[a-z0-9]{10}$"'
exit 1
fi
if virsh list --name --all | grep -vqE "^$vmname$" ; then
echo "Error: $vmname not found"
exit 1
fi
# this gets the ipv4
virsh domifaddr "$vmname" | awk '/vnet/ {print $4}' | cut -d'/' -f1