From bcdd193ba6483f09284ccc79a76db3d95f709e83 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Thu, 20 Apr 2017 09:59:48 -0700 Subject: [PATCH] uniq cidrs --- common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.sh b/common.sh index c4da5fd..5c2ed1a 100644 --- a/common.sh +++ b/common.sh @@ -92,7 +92,7 @@ function ipset_restore_from_cidr(){ # extract existing set configuration to create temporary set (set -o pipefail; $IPSET save "${set_name}${v}" 2>/dev/null | grep -m 1 '^create ' | sed "s/\(create ${set_name}${v}\)/\1-tmp/") || continue # populate with new data - decommentcat "${set_name}.cidr" "${set_name}.cidr.$(hostname -s)" 2>/dev/null | sed -n 's/\(.*'"${vmatch}"'.*\)/add '"${set_name}${v}-tmp"' \1/p' + decommentcat "${set_name}.cidr" "${set_name}.cidr.$(hostname -s)" 2>/dev/null | sed -n 's/\(.*'"${vmatch}"'.*\)/add '"${set_name}${v}-tmp"' \1/p' | sort -n | uniq done } -- 2.45.2