zapret/ipset/get_antizapret.sh

25 lines
570 B
Bash
Raw Normal View History

2016-02-22 17:54:18 +03:00
#!/bin/sh
# get ip list from antizapret.prostovpn.org
SCRIPT=$(readlink -f $0)
EXEDIR=$(dirname $SCRIPT)
. "$EXEDIR/def.sh"
#ZURL=https://github.com/zapret-info/z-i/raw/master/dump.csv
ZURL=http://antizapret.prostovpn.org/iplist.txt
2017-05-11 18:36:52 +03:00
ZIPLISTTMP=$TMPDIR/zapret-ip.txt
2016-02-22 17:54:18 +03:00
2016-03-16 08:33:26 +03:00
getuser
2016-02-22 17:54:18 +03:00
2017-05-11 18:36:52 +03:00
curl --fail --max-time 120 --max-filesize 10485760 -k -L "$ZURL" | cut_local >$ZIPLISTTMP &&
2016-02-22 17:54:18 +03:00
{
dlsize=$(wc -c "$ZIPLISTTMP" | cut -f 1 -d ' ')
if test $dlsize -lt 204800; then
2016-02-22 17:54:18 +03:00
echo list file is too small. can be bad.
exit 2
fi
mv -f $ZIPLISTTMP $ZIPLIST
"$EXEDIR/create_ipset.sh"
}