diff --git a/install_easy.sh b/install_easy.sh index 40e00ef..54a840d 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -233,10 +233,10 @@ select_getlist() echo if ask_yes_no $D "do you want to auto download ip/host list"; then if [ "$MODE_FILTER" = "hostlist" -o "$MODE_FILTER" = "autohostlist" ] ; then - GETLISTS="get_refilter_domains.sh get_antizapret_domains.sh" + GETLISTS="get_refilter_domains.sh get_antizapret_domains.sh get_reestr_resolvable_domains.sh" GETLIST_DEF="get_antizapret_domains.sh" else - GETLISTS="get_user.sh get_refilter_ipsum.sh get_antifilter_ip.sh get_antifilter_ipsmart.sh get_antifilter_ipsum.sh get_antifilter_ipresolve.sh get_antifilter_allyouneed.sh" + GETLISTS="get_user.sh get_refilter_ipsum.sh get_antifilter_ip.sh get_antifilter_ipsmart.sh get_antifilter_ipsum.sh get_antifilter_ipresolve.sh get_antifilter_allyouneed.sh get_reestr_preresolved.sh get_reestr_preresolved_smart.sh" GETLIST_DEF="get_antifilter_allyouneed.sh" fi ask_list GETLIST "$GETLISTS" "$GETLIST_DEF" && write_config_var GETLIST diff --git a/ipset/get_reestr_preresolved.sh b/ipset/get_reestr_preresolved.sh new file mode 100755 index 0000000..c0dbf45 --- /dev/null +++ b/ipset/get_reestr_preresolved.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +IPSET_DIR="$(dirname "$0")" +IPSET_DIR="$(cd "$IPSET_DIR"; pwd)" + +. "$IPSET_DIR/def.sh" + +TMPLIST="$TMPDIR/list.txt" + +BASEURL="https://raw.githubusercontent.com/bol-van/rulist/main" +URL4="$BASEURL/reestr_resolved4.txt" +URL6="$BASEURL/reestr_resolved6.txt" +#IPB4="$BASEURL/reestr_ipban4.txt" +#IPB6="$BASEURL/reestr_ipban6.txt" + +dl() +{ + # $1 - url + # $2 - file + # $3 - minsize + # $4 - maxsize + curl -H "Accept-Encoding: gzip" -k --fail --max-time 120 --connect-timeout 10 --retry 4 --max-filesize $4 -o "$TMPLIST" "$1" || + { + echo list download failed : $1 + exit 2 + } + dlsize=$(LC_ALL=C LANG=C wc -c "$TMPLIST" | xargs | cut -f 1 -d ' ') + if test $dlsize -lt $3; then + echo list is too small : $dlsize bytes. can be bad. + exit 2 + fi + zzcopy "$TMPLIST" "$2" + rm -f "$TMPLIST" +} + +getuser && { + [ "$DISABLE_IPV4" != "1" ] && { + dl "$URL4" "$ZIPLIST" 4096 4194304 +# dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576 + } + [ "$DISABLE_IPV6" != "1" ] && { + dl "$URL6" "$ZIPLIST6" 4096 4194304 +# dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576 + } +} + +"$IPSET_DIR/create_ipset.sh" diff --git a/ipset/get_reestr_preresolved_smart.sh b/ipset/get_reestr_preresolved_smart.sh new file mode 100755 index 0000000..0f6280d --- /dev/null +++ b/ipset/get_reestr_preresolved_smart.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +IPSET_DIR="$(dirname "$0")" +IPSET_DIR="$(cd "$IPSET_DIR"; pwd)" + +. "$IPSET_DIR/def.sh" + +TMPLIST="$TMPDIR/list.txt" + +BASEURL="https://raw.githubusercontent.com/bol-van/rulist/main" +URL4="$BASEURL/reestr_smart4.txt" +URL6="$BASEURL/reestr_smart6.txt" +#IPB4="$BASEURL/reestr_ipban4.txt" +#IPB6="$BASEURL/reestr_ipban6.txt" + +dl() +{ + # $1 - url + # $2 - file + # $3 - minsize + # $4 - maxsize + curl -H "Accept-Encoding: gzip" -k --fail --max-time 120 --connect-timeout 10 --retry 4 --max-filesize $4 -o "$TMPLIST" "$1" || + { + echo list download failed : $1 + exit 2 + } + dlsize=$(LC_ALL=C LANG=C wc -c "$TMPLIST" | xargs | cut -f 1 -d ' ') + if test $dlsize -lt $3; then + echo list is too small : $dlsize bytes. can be bad. + exit 2 + fi + zzcopy "$TMPLIST" "$2" + rm -f "$TMPLIST" +} + +getuser && { + [ "$DISABLE_IPV4" != "1" ] && { + dl "$URL4" "$ZIPLIST" 4096 4194304 +# dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576 + } + [ "$DISABLE_IPV6" != "1" ] && { + dl "$URL6" "$ZIPLIST6" 4096 4194304 +# dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576 + } +} + +"$IPSET_DIR/create_ipset.sh" diff --git a/ipset/get_reestr_resolvable_domains.sh b/ipset/get_reestr_resolvable_domains.sh new file mode 100755 index 0000000..8cab74f --- /dev/null +++ b/ipset/get_reestr_resolvable_domains.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +IPSET_DIR="$(dirname "$0")" +IPSET_DIR="$(cd "$IPSET_DIR"; pwd)" + +. "$IPSET_DIR/def.sh" + +TMPLIST="$TMPDIR/list_nethub.txt" + +BASEURL="https://raw.githubusercontent.com/bol-van/rulist/main" +URL="$BASEURL/reestr_hostname_resolvable.txt" +#IPB4="$BASEURL/reestr_ipban4.txt" +#IPB6="$BASEURL/reestr_ipban6.txt" + +dl() +{ + # $1 - url + # $2 - file + # $3 - minsize + # $4 - maxsize + curl -H "Accept-Encoding: gzip" -k --fail --max-time 120 --connect-timeout 10 --retry 4 --max-filesize $4 -o "$TMPLIST" "$1" || + { + echo list download failed : $1 + exit 2 + } + dlsize=$(LC_ALL=C LANG=C wc -c "$TMPLIST" | xargs | cut -f 1 -d ' ') + if test $dlsize -lt $3; then + echo list is too small : $dlsize bytes. can be bad. + exit 2 + fi + zzcopy "$TMPLIST" "$2" + rm -f "$TMPLIST" +} + +dl "$URL" "$ZHOSTLIST" 65536 67108864 + +hup_zapret_daemons + +#[ "$DISABLE_IPV4" != "1" ] && dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576 +#[ "$DISABLE_IPV6" != "1" ] && dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576 + +getipban +"$IPSET_DIR/create_ipset.sh" + +exit 0