X-Git-Url: http://git.squeep.com/?p=firewall-squeep;a=blobdiff_plain;f=common.sh;h=5c2ed1a56e052dc5b53a08e20dfeb4e4099e49d0;hp=c4da5fdfa43c8e41ed6e5abf9c9cdc54a665c19e;hb=HEAD;hpb=283b321d8414f8134c9ed46d64b5402d0161985f 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 }