diff options
Diffstat (limited to 'testing/scripts/function.sh')
-rwxr-xr-x | testing/scripts/function.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh index c4769678c..2dd465c85 100755 --- a/testing/scripts/function.sh +++ b/testing/scripts/function.sh @@ -156,6 +156,18 @@ check_commands() done } +# check if any of the given virtual guests are running +# $* - names of guests to check +running_any() +{ + command -v virsh >/dev/null || return 1 + for host in $* + do + virsh list --name | grep "^$host$" >/dev/null && return 0 + done + return 1 +} + ############################################# # search and replace strings throughout a # whole directory |