Skip to content

Commit

Permalink
improve grep pattern for ipv6 sets
Browse files Browse the repository at this point in the history
  • Loading branch information
toralf committed Jun 10, 2024
1 parent 061d179 commit 45caead
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 45caead

Please sign in to comment.