fixed makeconf.sh so it searches for ipv4_geo_blacklist instead of just blacklist
This commit is contained in:
parent
9507ebbb1a
commit
0507155ef2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue