Created
June 22, 2017 08:35
-
-
Save beginor/3b8e2eab0fbb41757213cc5b50f96dae to your computer and use it in GitHub Desktop.
Update host through shell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # update hosts | |
| echo "Start update hosts" | |
| echo "Create a new host file" | |
| touch hosts | |
| echo "Done!" | |
| echo "Update AD block hosts ..." | |
| curl https://raw.githubusercontent.com/vokins/yhosts/master/hosts >> hosts | |
| echo "Done!" | |
| echo "Update Google hosts ..." | |
| curl https://raw.githubusercontent.com/sy618/hosts/master/p >> hosts | |
| echo "Done!" | |
| echo "Update Youtube hosts ..." | |
| curl https://raw.githubusercontent.com/sy618/hosts/master/y >> hosts | |
| echo "Done!" | |
| echo "Update FQ hosts ..." | |
| curl https://raw.githubusercontent.com/racaljk/hosts/master/hosts >> hosts | |
| echo "Done!" | |
| echo "Start update your host file, please input your password:" | |
| sudo mv /etc/hosts /etc/hosts_$(date +%Y%m%d) | |
| echo "Current host is backup to /etc/hosts_$(date +%Y%m%d)" | |
| sudo mv hosts /etc/hosts | |
| echo "Host file update completed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment