summaryrefslogtreecommitdiffstats
path: root/functions.sh
diff options
context:
space:
mode:
authorGeorg Kunz <georg.kunz@est.tech>2020-08-02 22:35:33 +0200
committerGeorg Kunz <georg.kunz@est.tech>2020-08-17 22:40:14 +0200
commit357f4a4c278c95ecddab7fce1e69b1571cdd0bea (patch)
tree334d251841cb39b4692229b7cc909717f33ac47e /functions.sh
parent28d1cee5c7b95ae905a4481245d5d5650c87e101 (diff)
"Better" pattern matching for name of jump VM
The pattern currently used matches also non-exact hits, such as "jumphost" and "xci-jumphost". This tweak attempts to achieve better exact word matches. Note: the -w option of grep does not seem to do the trick as well. Signed-off-by: Georg Kunz <georg.kunz@est.tech> Change-Id: I8cb98a5540a41f5e6044efe12584403b7f4398df
Diffstat (limited to 'functions.sh')
-rwxr-xr-xfunctions.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/functions.sh b/functions.sh
index b0baf2d..55edfbf 100755
--- a/functions.sh
+++ b/functions.sh
@@ -10,10 +10,10 @@
# Clean up
clean_up() {
- if sudo virsh list --all | grep "${VM_NAME}.*running" ; then
+ if sudo virsh list --all | grep " ${VM_NAME} .*running" ; then
sudo virsh destroy "$VM_NAME"
fi
- if sudo virsh list --all | grep "${VM_NAME}" ; then
+ if sudo virsh list --all | grep " ${VM_NAME} " ; then
sudo virsh undefine "$VM_NAME"
fi
sudo rm -rf "/var/lib/libvirt/images/$VM_NAME"