NiKaro127

iBlockList to PeerGuardian

Dec 29th, 2012
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.18 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Blacklist's names & URLs arrays
  4. bl_name=([0]='spyware')
  5. bl_url=([0]='http://list.iblocklist.com/?list=bt_spyware&fileformat=p2p&archiveformat=gz')
  6. bl_name=(${bl_name[*]} [1]='webexploit')
  7. bl_url=(${bl_url[*]} [1]='http://list.iblocklist.com/?list=ghlzqtqxnzctvvajwwag&fileformat=p2p&archiveformat=gz')
  8. bl_name=(${bl_name[*]} [2]='spider')
  9. bl_url=(${bl_url[*]} [2]='http://list.iblocklist.com/?list=bt_spider&fileformat=p2p&archiveformat=gz')
  10. bl_name=(${bl_name[*]} [3]='hijacked')
  11. bl_url=(${bl_url[*]} [3]='http://list.iblocklist.com/?list=bt_hijacked&fileformat=p2p&archiveformat=gz')
  12. bl_name=(${bl_name[*]} [4]='dshield')
  13. bl_url=(${bl_url[*]} [4]='http://list.iblocklist.com/?list=bt_dshield&fileformat=p2p&archiveformat=gz')
  14. bl_name=(${bl_name[*]} [5]='bogon')
  15. bl_url=(${bl_url[*]} [5]='http://list.iblocklist.com/?list=bt_bogon&fileformat=p2p&archiveformat=gz')
  16.  
  17. # For each blacklist set above
  18. for i in {0..5}; do
  19.         # Download blacklist
  20.         wget --output-document=/tmp/blacklist_${bl_name[$i]}.gz -w 3 ${bl_url[$i]}
  21.         # Extract list
  22.         gzip -d /tmp/blacklist_${bl_name[$i]}.gz
  23. done
  24.  
  25. mv /tmp/blacklist_* /etc/pgl/blocklists.local/
  26.  
  27. exit 0
Advertisement
Add Comment
Please, Sign In to add comment