Abort early if curl is missing

This commit is contained in:
Nils Steinger 2017-04-07 16:24:29 +02:00
parent 3742cbc215
commit 8697daa181
1 changed files with 6 additions and 0 deletions

View File

@ -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'