]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Validate interface stats files
authorJohannes Truschnigg <johannes@truschnigg.info>
Thu, 17 Mar 2022 18:54:11 +0000 (19:54 +0100)
committerJohannes Truschnigg <johannes@truschnigg.info>
Thu, 17 Mar 2022 18:54:11 +0000 (19:54 +0100)
lagdetect.sh

index f9644944b143fb71d28a8a404e2200b7c8498e33..b3b4110dd513c43351d194000a1338a02e5ef7cd 100755 (executable)
@@ -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