Skip to content

Instantly share code, notes, and snippets.

@delfer
Last active April 26, 2018 19:51
Show Gist options
  • Select an option

  • Save delfer/8d70a56d43e8f6e015d9d43e81497c8a to your computer and use it in GitHub Desktop.

Select an option

Save delfer/8d70a56d43e8f6e015d9d43e81497c8a to your computer and use it in GitHub Desktop.
ipset create rkn hash:ip || ipset flush rkn
ipset create rkn2 hash:ip || ipset flush rkn2
wget http://api.antizapret.info/all.php\?type\=csv -O - | cut -d';' -f4 | sed -e "s#,#\n#g" | sort | uniq | grep -v '/' > /tmp/IPlist
while read IP; do ipset add rkn $IP || ipset add rkn2 $IP ; done </tmp/IPlist
rm -f /tmp/IPlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment