From 0507155ef24954af9be5622ed79b5c8125b62ae8 Mon Sep 17 00:00:00 2001 From: celso Date: Fri, 13 Dec 2024 05:47:52 -0300 Subject: [PATCH] fixed makeconf.sh so it searches for ipv4_geo_blacklist instead of just blacklist --- makeconf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makeconf.sh b/makeconf.sh index 34afb05..167bafa 100755 --- a/makeconf.sh +++ b/makeconf.sh @@ -41,7 +41,7 @@ done # figure out what countries, if any, we're blocking declare -a countries=($(ls -1 /var/geoipsets/dbip/nftset/ipv4/)) # figure out which line defines the elements of the blacklist set -line="$(grep -nA3 blacklist nftables.conf | grep elements | awk 'BEGIN{FS="-"} {print $1}')" +line="$(grep -nA3 "ipv4_geo_blacklist" nftables.conf | grep elements | awk 'BEGIN{FS="-"} {print $1}')" # insert names of the countries to block into the line that defines the elements of the set for i in ${countries[@]}; do sed -i "${line} s/elements = { \([A-Z]\{2\}\.ipv4,\? \)*/elements = { \1\$${i}, /" nftables.conf