summaryrefslogtreecommitdiff
path: root/testing/scripts/function.sh
diff options
context:
space:
mode:
authorRomain Francoise <rfrancoise@debian.org>2014-10-21 19:28:38 +0200
committerRomain Francoise <rfrancoise@debian.org>2014-10-21 19:41:50 +0200
commitb23b0e5609ed4b3d29396a1727aab035fa4a395f (patch)
tree091d0b144dd92a0c124b7fbe9eae68f79cb975dc /testing/scripts/function.sh
parent4a01a7e2574040cf246fd00ebff173b873c17349 (diff)
downloadvyos-strongswan-b23b0e5609ed4b3d29396a1727aab035fa4a395f.tar.gz
vyos-strongswan-b23b0e5609ed4b3d29396a1727aab035fa4a395f.zip
Import upstream release 5.2.1
Diffstat (limited to 'testing/scripts/function.sh')
-rwxr-xr-xtesting/scripts/function.sh12
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