Commit 33720dee authored by bol-van's avatar bol-van
Browse files

ipset: remove zapret-info based scripts because it's gone

parent 994e9c34
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -581,3 +581,7 @@ blockcheck: fix broken dns cache

nfqws: fix broken l7proto profile rediscovery
nfqws: backport from nfqws2 nl80211 ssid discovery fix for newer kernels

73.6

ipset: remove zapret-info based scripts because it's gone
+2 −2
Original line number Diff line number Diff line
@@ -268,10 +268,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 get_reestr_resolvable_domains.sh get_reestr_hostlist.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 get_reestr_resolve.sh get_reestr_preresolved.sh get_reestr_preresolved_smart.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

ipset/get_reestr_hostlist.sh

deleted100755 → 0
+0 −65
Original line number Diff line number Diff line
#!/bin/sh

IPSET_DIR="$(dirname "$0")"
IPSET_DIR="$(cd "$IPSET_DIR"; pwd)"

. "$IPSET_DIR/def.sh"

ZREESTR="$TMPDIR/zapret.txt.gz"
IPB="$TMPDIR/ipb.txt"
ZURL_REESTR=https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv.gz

dl_checked()
{
  # $1 - url
  # $2 - file
  # $3 - minsize
  # $4 - maxsize
  # $5 - maxtime
  curl -k --fail --max-time $5 --connect-timeout 10 --retry 4 --max-filesize $4 -o "$2" "$1" ||
  {
   echo list download failed : $1
   return 2
  }
  dlsize=$(LC_ALL=C LANG=C wc -c "$2" | xargs | cut -f 1 -d ' ')
  if test $dlsize -lt $3; then
   echo list is too small : $dlsize bytes. can be bad.
   return 2
  fi
  return 0
}

reestr_list()
{
 LC_ALL=C LANG=C gunzip -c "$ZREESTR" | cut -s -f2 -d';' | LC_ALL=C  LANG=C nice -n 5 sed -Ee 's/^\*\.(.+)$/\1/' -ne 's/^[a-z0-9A-Z._-]+$/&/p' | $AWK '{ print tolower($0) }'
}
reestr_extract_ip()
{
 LC_ALL=C LANG=C gunzip -c | nice -n 5 $AWK -F ';' '($1 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}/) && (($2 == "" && $3 == "") || ($1 == $2)) {gsub(/ \| /, RS); print $1}' | LC_ALL=C  LANG=C $AWK '{split($1, a, /\|/); for (i in a) {print a[i]}}'
}

ipban_fin()
{
 getipban
 "$IPSET_DIR/create_ipset.sh"
}

dl_checked "$ZURL_REESTR" "$ZREESTR" 204800 251658240 600 || {
 ipban_fin
 exit 2
}

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}($|(\/[0-9]{2}$))/' "$IPB" | cut_local | 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" | cut_local6 | ip2net6 | zz "$ZIPLIST_IPBAN6"
rm -f "$IPB"

hup_zapret_daemons

ipban_fin

exit 0
+6 −6
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@ 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"
#IPB4="$BASEURL/reestr_ipban4.txt"
#IPB6="$BASEURL/reestr_ipban6.txt"

dl()
{
@@ -35,12 +35,12 @@ dl()

getuser && {
 [ "$DISABLE_IPV4" != "1" ] && {
 	dl "$URL4" "$ZIPLIST" 32768 4194304
 	dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576
	dl "$URL4" "$ZIPLIST" 4096 4194304
#	dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576
 }
 [ "$DISABLE_IPV6" != "1" ] && {
 	dl "$URL6" "$ZIPLIST6" 8192 4194304
 	dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576
	dl "$URL6" "$ZIPLIST6" 4096 4194304
#	dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576
 }
}

+6 −6
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@ 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"
#IPB4="$BASEURL/reestr_ipban4.txt"
#IPB6="$BASEURL/reestr_ipban6.txt"

dl()
{
@@ -35,12 +35,12 @@ dl()

getuser && {
 [ "$DISABLE_IPV4" != "1" ] && {
 	dl "$URL4" "$ZIPLIST" 32768 4194304
 	dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576
	dl "$URL4" "$ZIPLIST" 4096 4194304
#	dl "$IPB4" "$ZIPLIST_IPBAN" 8192 1048576
 }
 [ "$DISABLE_IPV6" != "1" ] && {
 	dl "$URL6" "$ZIPLIST6" 8192 4194304
 	dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576
	dl "$URL6" "$ZIPLIST6" 4096 4194304
#	dl "$IPB6" "$ZIPLIST_IPBAN6" 128 1048576
 }
}

Loading