From edc41554031abb33ce7cf0c07607d0f4a10decdd Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 26 Nov 2023 16:32:37 +0300 Subject: [PATCH] get_reestr : also add subnets to ipban --- ipset/get_reestr_hostlist.sh | 5 +++-- ipset/get_reestr_resolve.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ipset/get_reestr_hostlist.sh b/ipset/get_reestr_hostlist.sh index 46b7484..a6da43f 100755 --- a/ipset/get_reestr_hostlist.sh +++ b/ipset/get_reestr_hostlist.sh @@ -52,9 +52,10 @@ dl_checked "$ZURL_REESTR" "$ZREESTR" 204800 251658240 600 || { reestr_list | sort -u | zz "$ZHOSTLIST" reestr_extract_ip <"$ZREESTR" >"$IPB" + rm -f "$ZREESTR" -[ "$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" +[ "$DISABLE_IPV4" != "1" ] && $AWK '/^([0-9]{1,3}\.){3}[0-9]{1,3}($|(\/[0-9]{1,2}$))/' "$IPB" | ip2net4 | zz "$ZIPLIST_IPBAN" +[ "$DISABLE_IPV6" != "1" ] && $AWK '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}($|(\/[0-9]{2,3}$))/' "$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 2fa0b46..e386e45 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" - [ "$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" + [ "$DISABLE_IPV4" != "1" ] && $AWK '/^([0-9]{1,3}\.){3}[0-9]{1,3}($|(\/[0-9]{1,2}$))/' "$IPB" | ip2net4 | zz "$ZIPLIST_IPBAN" + [ "$DISABLE_IPV6" != "1" ] && $AWK '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}($|(\/[0-9]{2,3}$))/' "$IPB" | ip2net6 | zz "$ZIPLIST_IPBAN6" rm -f "$IPB" echo preparing dig list ..