Advertisement
pullso

pavadan

May 6th, 2021
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. ### Custom user script
  4. ### Called after router started and network is ready
  5.  
  6. ### Example - load ipset modules
  7. #modprobe ip_set
  8. #modprobe ip_set_hash_ip
  9. #modprobe ip_set_hash_net
  10. #modprobe ip_set_bitmap_ip
  11. #modprobe ip_set_list_set
  12. #modprobe xt_set
  13.  
  14. touch /tmp/hosts
  15. sleep 7
  16. URLS="https://schakal.ru/hosts/alive_hosts_mail_fb.txt"
  17.  
  18. logger "Updating HOSTS-file..." && wget -T 10 -qO- $URLS | sed 's/\t/ /g' | sed 's/\r//' | sed 's/0.0.0.0/127.0.0.1/g' | grep "^127.0.0.1" | cut -d " " -f 1,2 | tr A-Z a-z | sort | uniq > /tmp/hosts && logger "HOSTS-file has been successfully updated."
  19.  
  20. sed -i '1d' /tmp/hosts
  21. sed -i '/localhost/d' /tmp/hosts
  22. sed -i '/127.0.0.1 l-stat.livejournal.net/d' /tmp/hosts
  23. sed -i '/127.0.0.1 clck.yandex./d' /tmp/hosts
  24. sed -i '/127.0.0.1 adv.gpm-digital.com/d' /tmp/hosts
  25. sed -i '/127.0.0.1 c.allegrostatic.pl/d' /tmp/hosts
  26.  
  27. killall -SIGHUP dnsmasq
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement