From 45caeada3000f089d2fa31d041873bb851048d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toralf=20F=C3=B6rster?= Date: Mon, 10 Jun 2024 11:01:12 +0200 Subject: [PATCH] improve grep pattern for ipv6 sets --- metrics.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metrics.sh b/metrics.sh index b955e49..e4d9163 100755 --- a/metrics.sh +++ b/metrics.sh @@ -111,9 +111,9 @@ function printMetrics() { for v in "" 6; do ipset list -t | grep -e "^N" | xargs -L 2 | awk '/^Name: tor-/ { print $2, $6 }' | if [[ $v == "6" ]]; then - grep -e "[a-z]6 " -e "[a-z]6-" + grep -E -e "-[a-z]+6[ -]" else - grep -v -e "[a-z]6 " -e "[a-z]6-" + grep -v -E -e "-[a-z]+6[ -]" fi | while read -r name size; do mode=$(cut -f 2 -d '-' -s <<<$name | tr -d '6')