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