From 8697daa1812c41fdef6eb5fad3220357866dc930 Mon Sep 17 00:00:00 2001 From: Nils Steinger Date: Fri, 7 Apr 2017 16:24:29 +0200 Subject: [PATCH] Abort early if curl is missing --- nench.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nench.sh b/nench.sh index 4dd0abd..5f952db 100755 --- a/nench.sh +++ b/nench.sh @@ -23,6 +23,12 @@ Bps_to_MiBps() awk '{ printf "%.2f MiB/s\n", $0 / 1024 / 1024 } END { if (NR == 0) { print "error" } }' } +if ! command_exists curl +then + printf '%s\n' 'This script requires curl, but it could not be found.' 1>&2 + exit 1 +fi + printf '%s\n' '-------------------------' printf ' nench.sh benchmark\n' date -u '+ %F %T UTC'