From: Johannes Truschnigg Date: Thu, 17 Mar 2022 18:54:11 +0000 (+0100) Subject: Validate interface stats files X-Git-Url: https://johannes.truschnigg.info/gitweb/?a=commitdiff_plain;h=3838294ef3c178c72c262a13283d229d0ebe4109;p=sqm_lagthrottle Validate interface stats files --- 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