From 0505986743df1ec93e9eda2f4c0e102350de7e8a Mon Sep 17 00:00:00 2001 From: ansible Date: Thu, 8 Oct 2015 21:16:19 +0300 Subject: Make create-vm, remove-vm read a config file This allows me to run them on places other than my laptop. --- remove-vm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'remove-vm') diff --git a/remove-vm b/remove-vm index 680bef4..363f2a0 100755 --- a/remove-vm +++ b/remove-vm @@ -7,14 +7,14 @@ set -eu # Command line parameters. name="$1" -# What volume group should we use? -vg="exolobe1-vg" +# Read config variables. +. "$HOME/.config/ansibleness/vm.conf" # Shut down and remove the VM, if it exists. -if virsh list --all | grep -F "$name" > /dev/null +if virsh -c qemu:///system list --all | grep -F "$name" > /dev/null then - virsh destroy "$name" || true - virsh undefine "$name" + virsh -c qemu:///system destroy "$name" || true + virsh -c qemu:///system undefine "$name" fi # Remove the LV, if it exists. -- cgit v1.2.1