From 01d9ff4e885610041678621da0e64cb61f1b4994 Mon Sep 17 00:00:00 2001 From: Nils Steinger Date: Thu, 1 Jun 2017 18:14:28 +0200 Subject: [PATCH] Use native ioping command if installed --- nench.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nench.sh b/nench.sh index 79f5270..e6a2051 100755 --- a/nench.sh +++ b/nench.sh @@ -120,8 +120,14 @@ printf '%s\n' '-------------------------------------------------' printf '\n' -curl -s --max-time 10 -o ioping.static http://wget.racing/ioping.static -chmod +x ioping.static +if ! command_exists ioping +then + curl -s --max-time 10 -o ioping.static http://wget.racing/ioping.static + chmod +x ioping.static + ioping_cmd="./ioping.static" +else + ioping_cmd="ioping" +fi # Basic info printf 'Processor: ' @@ -166,9 +172,9 @@ printf '\n' # ioping printf 'ioping: seek rate\n ' -./ioping.static -R -w 5 . | tail -n 1 +"$ioping_cmd" -R -w 5 . | tail -n 1 printf 'ioping: sequential read speed\n ' -./ioping.static -RL -w 5 . | tail -n 2 | head -n 1 +"$ioping_cmd" -RL -w 5 . | tail -n 2 | head -n 1 printf '\n'