summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xremove_stale_vms5
1 files changed, 3 insertions, 2 deletions
diff --git a/remove_stale_vms b/remove_stale_vms
index dbcc159..74c63c0 100755
--- a/remove_stale_vms
+++ b/remove_stale_vms
@@ -1,9 +1,9 @@
-#!/bin/sh
+#!/bin/bash
#
# removes all libvirt domains older than 1 day matching given regex
-VM_REGEX='$test_'
+VM_REGEX='test_'
remove_domain () {
echo "Destroying and undefining $vm"
@@ -13,6 +13,7 @@ remove_domain () {
for vm in $(find /etc/libvirt/qemu -maxdepth 1 -type f -mmin +1440 -exec basename -s .xml {} \;)
do
+ #echo $vm
[[ "$vm" =~ "$VM_REGEX" ]] && remove_domain $vm
done