Guest User

Untitled

a guest
Jun 3rd, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. --- gethosts.sh.orig 2014-06-03 12:13:38.568119496 +0200
  2. +++ gethosts.sh 2014-06-03 12:22:27.542742544 +0200
  3. @@ -8,10 +8,10 @@ echo "Vytvářím dočasné soubory"
  4. temphosts1=$(mktemp)
  5. temphosts2=$(mktemp)
  6. echo "Stahuji černou listinu"
  7. -wget -nv -O - http://winhelp2002.mvps.org/hosts.txt >> $temphosts1
  8. -wget -nv -O - http://hosts-file.net/ad_servers.asp >> $temphosts1
  9. -wget -nv -O - http://someonewhocares.org/hosts/hosts >> $temphosts1
  10. -wget -nv -O - "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" >> $temphosts1
  11. +wget -nv -O - http://winhelp2002.mvps.org/hosts.txt >> "$temphosts1"
  12. +wget -nv -O - http://hosts-file.net/ad_servers.asp >> "$temphosts1"
  13. +wget -nv -O - http://someonewhocares.org/hosts/hosts >> "$temphosts1"
  14. +wget -nv -O - "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" >> "$temphosts1"
  15. echo "Upravuji černou listinu:
  16. # 1. Odstranění znaků Carriage Return...
  17. # 2. Mazání řádků, které nezačínají 127.0.0.1...
  18. @@ -21,13 +21,14 @@ echo "Upravuji černou listinu:
  19. # 6. Odstranění komentářů...
  20. # 7. Vyčištění koncových mezer
  21. # 8. Třídění a odstranění duplicit..."
  22. -sed -e 's/\r//' -e '/^127.0.0.1/!d' -e '/localhost/d' -e 's/127.0.0.1/0.0.0.0/' -e 's/ \+/\t/' -e 's/#.*$//' -e 's/[ \t]*$//' < $temphosts1 | sort -u > $temphosts2
  23. +sed -e 's/\r//' -e '/^127\.0\.0\.1/!d' -e '/localhost/d' -e 's/127\.0\.0\.1/0.0.0.0/' -e 's/ \+/\t/' -e 's/#.*$//' -e 's/[ \t]*$//' < "$temphosts1" | sort -u > "$temphosts2"
  24. +
  25. # Combine system hosts with adblocks
  26. echo "Slučuji s původním hosts souborem..."
  27. -echo -e "\n# Vygenerováno dne $(date)" | cat /etc/hosts.d/hosts.conf - $temphosts2 > /etc/hosts.d/hosts-block
  28. -echo -e "\n# Blokováno $(cat /etc/hosts.d/hosts-block | grep 0.0.0.0 | wc -w) adres" >> /etc/hosts.d/hosts-block
  29. +echo -e "\n# Vygenerováno dne $(date)" | cat /etc/hosts.d/hosts.conf - "$temphosts2" > /etc/hosts.d/hosts-block
  30. +echo -e "\n# Blokováno $(cat /etc/hosts.d/hosts-block | fgrep 0.0.0.0 | wc -w) adres" >> /etc/hosts.d/hosts-block
  31. echo "Čistím dočasné soubory..."
  32. -rm $temphosts1 $temphosts2
  33. +rm "$temphosts1" "$temphosts2"
  34. echo "Kopíruji zpět vylepšený soubor /etc/hosts"
  35. cp /etc/hosts.d/hosts-block /etc/hosts
  36. echo "Hotovo"
Advertisement
Add Comment
Please, Sign In to add comment