aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts/function.sh
diff options
context:
space:
mode:
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