zapret/ipset/get_antizapret.sh
2017-05-11 18:36:52 +03:00

25 lines
570 B
Bash
Executable File

#!/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
ZIPLISTTMP=$TMPDIR/zapret-ip.txt
getuser
curl --fail --max-time 120 --max-filesize 10485760 -k -L "$ZURL" | cut_local >$ZIPLISTTMP &&
{
dlsize=$(wc -c "$ZIPLISTTMP" | cut -f 1 -d ' ')
if test $dlsize -lt 204800; then
echo list file is too small. can be bad.
exit 2
fi
mv -f $ZIPLISTTMP $ZIPLIST
"$EXEDIR/create_ipset.sh"
}