From 3838294ef3c178c72c262a13283d229d0ebe4109 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Thu, 17 Mar 2022 19:54:11 +0100 Subject: [PATCH] Validate interface stats files --- lagdetect.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lagdetect.sh b/lagdetect.sh index f964494..b3b4110 100755 --- a/lagdetect.sh +++ b/lagdetect.sh @@ -145,6 +145,17 @@ then fi +for f in "${STATS_RX}" "${STATS_TX}" +do + read -r _bw < "${f}" + if ! __is_int "${_bw}" + then + printf 'FATAL: Stats file "%s" content seems bogus\n' "${f}" + exit 1 + fi +done + + set -u -- 2.39.5