ipset update scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ipset_update.sh 830B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. cd "$(dirname "$0")"
  3. date_good=`date +"%Y-%m-%d %T"`
  4. echo "* ${date_good} Runinng list update"
  5. python ./lists_updater.py
  6. echo "* Create ipset blocklists if not already existing"
  7. ipset create blacklist_net -exist hash:net family inet hashsize 16777216 maxelem 16777216
  8. ipset create blacklist_ipv4 -exist hash:ip family inet hashsize 16777216 maxelem 16777216
  9. #ipset create blacklist_ipv6 -exist hash:net family inet hashsize 16777216 maxelem 16777216
  10. echo "* Import lists into ipset"
  11. echo "== Import ipv4 ipset"
  12. ipset restore < ipset_ipv4.set
  13. #echo "== Import ipv6 ipset"
  14. #ipset restore < ipset_ipv6.set
  15. echo "== Import subnets ipset"
  16. ipset restore < ipset_subnets.set
  17. echo "* Saving ipset"
  18. ipset save > /etc/ipset.conf
  19. echo "* Cleanup ipset files"
  20. rm ./ipset_ipv4.set
  21. #rm ./ipset_ipv6.set
  22. rm ./ipset_subnets.set