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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. function loading {
  3. char="|"
  4. while :; do
  5. case "$char" in
  6. "|")
  7. char="/"
  8. ;;
  9. "/")
  10. char="-"
  11. ;;
  12. "-")
  13. char="\\"
  14. ;;
  15. "\\")
  16. char="|"
  17. ;;
  18. esac
  19. sleep .2s
  20. echo -en "\rLoading $char"
  21. done
  22. }
  23. loading &
  24. pid=$!
  25. echo -e "\nDownloading Hosts"
  26. rm ~/.hosts/hostsfile &&
  27. touch ~/.hosts/hostsfile &&
  28. wget http://www.malwaredomainlist.com/hostslist/hosts.txt -q -O ~/.hosts/1.host &&
  29. wget "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -q -O ~/.hosts/5.host &&
  30. wget http://hosts-file.net/ad_servers.asp -q -O ~/.hosts/6.host &&
  31. sleep 2 &&
  32. # do something
  33. echo -e "\nDownloading Complete Begin merge..."
  34. sleep 2s &&
  35. cat ~/.hosts/1.host ~/.hosts/5.host ~/.hosts/6.host > ~/.hosts/hostsfile
  36. clear &&
  37. kill -9 $pid
  38. wait $pid 2>/dev/null # Supress "Killed" message
  39. echo -en "\r\033[K" # Completely overwrite last line
  40. echo "Done."