Advertisement
wariat

hosts.sh

May 23rd, 2017
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.13 KB | None | 0 0
  1. #!/system/xbin/bash
  2.  
  3. # copyleft 2015 by wariat
  4. # Manual:
  5. # bash /sdcard/scripts/hosts.sh check
  6. # su -c "bash /sdcard/scripts/hosts.sh"
  7. # su -c "bash /sdcard/scripts/hosts.sh block"
  8.  
  9. if [ "$1" == "" ]
  10. then
  11.   echo "
  12.  copyleft 2015 by wariat
  13.  Manual:
  14.  $ hosts.sh check
  15.  # hosts.sh reset
  16.  # hosts.sh block
  17.  "
  18.   exit
  19. fi
  20.  
  21. if [ "$1" == "check" ]
  22. then
  23.   cat /etc/hosts
  24.   exit
  25. fi
  26.  
  27. if [ "$1" == "reset" ] || [ "$1" == "block" ]
  28. then
  29.   echo "remount rw"
  30.   mount -o remount,rw /system
  31.  
  32.   echo '127.0.0.1 localhost' > /etc/hosts
  33.   echo '::1       ip6-localhost' >> /etc/hosts
  34. fi
  35.  
  36.  
  37. if [ "$1" == "block" ]
  38. then
  39.   echo "blokuje"
  40.   echo "# Block teh traffic block :D
  41. 127.0.0.1 www.panoramio.com
  42. 127.0.0.1 lh1.ggpht.com
  43. 127.0.0.1 lh2.ggpht.com
  44. 127.0.0.1 lh3.ggpht.com
  45. 127.0.0.1 lh4.ggpht.com
  46. 127.0.0.1 lh5.ggpht.com
  47. 127.0.0.1 lh6.ggpht.com
  48. 127.0.0.1 lh7.ggpht.com
  49. 127.0.0.1 lh8.ggpht.com
  50. 127.0.0.1 lh9.ggpht.com
  51. 127.0.0.1 lh3.googleusercontent.com
  52. "  >> /etc/hosts
  53. fi
  54. sync
  55.  
  56.  
  57. if [ "$1" == "reset" ] || [ "$1" == "block" ]
  58. then
  59.   echo "remount ro"
  60.   mount -o remount,ro /system
  61. fi
  62.  
  63. cat /etc/hosts
  64.  
  65. sleep 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement