From 9b52a53df21071b224d7dde6c80a24c56d546e2c Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 26 Nov 2023 14:39:38 +0300 Subject: [PATCH] reestr lists: honour ipvX_disable --- ipset/get_reestr_hostlist.sh | 4 ++-- ipset/get_reestr_resolve.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ipset/get_reestr_hostlist.sh b/ipset/get_reestr_hostlist.sh index aa5ad18..46b7484 100755 --- a/ipset/get_reestr_hostlist.sh +++ b/ipset/get_reestr_hostlist.sh @@ -53,8 +53,8 @@ reestr_list | sort -u | zz "$ZHOSTLIST" reestr_extract_ip <"$ZREESTR" >"$IPB" rm -f "$ZREESTR" -$AWK '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' "$IPB" | ip2net4 | zz "$ZIPLIST_IPBAN" -$AWK '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/' "$IPB" | ip2net6 | zz "$ZIPLIST_IPBAN6" +[ "$DISABLE_IPV4" != "1" ] && $AWK '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' "$IPB" | ip2net4 | zz "$ZIPLIST_IPBAN" +[ "$DISABLE_IPV6" != "1" ] && $AWK '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/' "$IPB" | ip2net6 | zz "$ZIPLIST_IPBAN6" rm -f "$IPB" hup_zapret_daemons diff --git a/ipset/get_reestr_resolve.sh b/ipset/get_reestr_resolve.sh index 74b7201..2fa0b46 100755 --- a/ipset/get_reestr_resolve.sh +++ b/ipset/get_reestr_resolve.sh @@ -50,8 +50,8 @@ getuser && { echo preparing ipban list .. reestr_extract_ip <"$ZREESTR" >"$IPB" - $AWK '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' "$IPB" | ip2net4 | zz "$ZIPLIST_IPBAN" - $AWK '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/' "$IPB" | ip2net6 | zz "$ZIPLIST_IPBAN6" + [ "$DISABLE_IPV4" != "1" ] && $AWK '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/' "$IPB" | ip2net4 | zz "$ZIPLIST_IPBAN" + [ "$DISABLE_IPV6" != "1" ] && $AWK '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/' "$IPB" | ip2net6 | zz "$ZIPLIST_IPBAN6" rm -f "$IPB" echo preparing dig list ..