From 3b40caf2b7655797c790e2b7ef520cd6ca18b284 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 10 Sep 2024 01:02:38 +0000 Subject: [PATCH] Don't fail to print dropcount when zero rules are installed --- dropcount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dropcount.sh b/dropcount.sh index 6960ef9..18d96a2 100755 --- a/dropcount.sh +++ b/dropcount.sh @@ -34,7 +34,7 @@ echo "$MAP_CONTENTS" | { echo -e "${PACKETS[2]}\t$(( ${BYTES[2]} / 1000 ))\tInvalid/rejected IHL IPv4 field" echo -e "${PACKETS[3]}\t$(( ${BYTES[3]} / 1000 ))\tRejected IPv6 fragments" C=4 - if [ "$(wc -l "$(dirname ${BASH_SOURCE[0]})/installed-rules.txt")" != "0" ]; then + if [ "$(cat "$(dirname ${BASH_SOURCE[0]})/installed-rules.txt" | wc -c)" -gt "1" ]; then while read LINE; do echo -e "${PACKETS["$C"]}\t$(( ${BYTES["$C"]} / 1000 ))\t$LINE" C=$(( $C + 1 )) -- 2.39.5