From b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 09:49:04 +0100 Subject: Test availability of required commands --- testing/scripts/function.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'testing/scripts/function.sh') 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 -- cgit v1.2.3