squid.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. clear
  3. if [[ "$EUID" -ne 0 ]]; then
  4. echo -e "\033[1;31mScript need to be run as root!\033[0m"; exit 1
  5. fi
  6. apt-get -qq update
  7. apt-get -y -qq install squid
  8. alamat_ip=$(wget -qO- ipv4.icanhazip.com)
  9. echo "acl localnet src 0.0.0.1-0.255.255.255
  10. acl localnet src 10.0.0.0/8
  11. acl localnet src 100.64.0.0/10
  12. acl localnet src 169.254.0.0/16
  13. acl localnet src 172.16.0.0/12
  14. acl localnet src 192.168.0.0/16
  15. acl localnet src fc00::/7
  16. acl localnet src fe80::/10
  17. acl SSL_ports port 443
  18. acl Safe_ports port 80
  19. acl Safe_ports port 21
  20. acl Safe_ports port 443
  21. acl Safe_ports port 70
  22. acl Safe_ports port 210
  23. acl Safe_ports port 1025-65535
  24. acl Safe_ports port 280
  25. acl Safe_ports port 488
  26. acl Safe_ports port 591
  27. acl Safe_ports port 777
  28. acl CONNECT method CONNECT
  29. acl cybertize dst $alamat_ip/24
  30. http_access allow cybertize
  31. http_access allow localnet
  32. http_access allow localhost
  33. http_access allow manager localhost
  34. http_access deny manager
  35. http_access deny all
  36. http_port 3128
  37. http_port 8080
  38. http_port 8000
  39. cache deny all
  40. access_log none
  41. cache_store_log none
  42. cache_log /dev/null
  43. hierarchy_stoplist cgi-bin ?
  44. refresh_pattern ^ftp: 1440 20% 10080
  45. refresh_pattern ^gopher: 1440 0% 1440
  46. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  47. refresh_pattern . 0 20% 4320
  48. visible_hostname www.squid-cache.org" > /etc/squid/squid.conf
  49. systemctl restart squid
  50. echo
  51. echo -e "\033[1;32mTahniah, Kami telah selesai dengan pemasangan squid.\033[0m"
  52. echo
  53. echo 'Use my referral link https://m.do.co/c/a28a40414d6a'
  54. echo 'to gets $100 credit into your DigitalOcean account.'
  55. echo
  56. echo 'Hak Cipta 2021 Doctype, Dikuasakan oleh Cybertize.'
  57. sleep 5