From c516a678e0d0ae987e7741339424ad8c3cd15581 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Sat, 19 Mar 2022 17:56:18 +0100 Subject: [PATCH] Convert to if/then for consistency --- lagdetect.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lagdetect.sh b/lagdetect.sh index 8fe0eb1..331cf63 100755 --- a/lagdetect.sh +++ b/lagdetect.sh @@ -87,7 +87,11 @@ return 1 for p in traceroute fping awk tc ip do - type "${p}" >/dev/null || { printf 'FATAL: Required program "%s" not installed.\n' "${p}" >&2; exit 1; } + if ! type "${p}" >/dev/null + then + printf 'FATAL: Required program "%s" not installed.\n' "${p}" >&2 + exit 1 + fi done -- 2.39.5