From cc4c01debe18293f9ae9643fb4ef6499d2277dac Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 8 Sep 2016 12:53:33 +0000 Subject: fix remove_stale_vms --- remove_stale_vms | 5 +++-- 1 file 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 -- cgit v1.2.3