aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts/function.sh
diff options
context:
space:
mode:
authorReto Buerki <reet@codelabs.ch>2012-12-09 09:49:04 +0100
committerTobias Brunner <tobias@strongswan.org>2013-01-17 16:54:54 +0100
commitb24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff (patch)
treef62e508f4e1e8514def5e845d82d73204afb6f10 /testing/scripts/function.sh
parentf241f46d88f06393e8dd4e8f0a9a444c7f9c2059 (diff)
downloadstrongswan-b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff.tar.bz2
strongswan-b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff.tar.xz
Test availability of required commands
Diffstat (limited to 'testing/scripts/function.sh')
-rwxr-xr-xtesting/scripts/function.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh
index d72708246..2a801a7a5 100755
--- a/testing/scripts/function.sh
+++ b/testing/scripts/function.sh
@@ -148,6 +148,16 @@ load_qemu_nbd()
fi
}
+# check if given commands exist in $PATH
+# $* - commands to check
+check_commands()
+{
+ for i in $*
+ do
+ command -v $i >/dev/null || { die "Required command $i not found"; exit 1; }
+ done
+}
+
#############################################
# search and replace strings throughout a
# whole directory