Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
scripts/hosts-update.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
42 lines (35 sloc)
1.21 KB
This file contains 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
#!/bin/bash | |
# Hosts file update script. Written by Christian Charukiewicz. | |
# | |
# --------------- Updated: July-15-2014 ------------------ | |
# | |
# Grabs the hosts files from the following two websites: | |
# | |
# - http://winhelp2002.mvps.org/ | |
# - http://someonewhocares.org/hosts/ | |
# | |
# Appends the contents of both hosts files to your local /etc/hosts file. | |
# | |
# Will also create a /etc/hosts-original the first time you run the script | |
# as a backup/starting point. | |
echo "Checking if copy of original hosts file exists..." | |
if [ -e /etc/hosts-original ] | |
then | |
echo "Copy of original exists." | |
cat /etc/hosts-original > /etc/hosts | |
else | |
echo "Copy of original does not exist. Copying..." | |
cat /etc/hosts > /etc/hosts-original | |
fi | |
echo "Downloading mvps.org hosts file..." | |
wget http://winhelp2002.mvps.org/hosts.txt --output-document=hosts-mvps | |
echo "Downloading someonewhocares.org hosts file..." | |
wget http://someonewhocares.org/hosts/zero/hosts --output-document=hosts-swc | |
echo "Adding mvps.org hosts file content to main hosts file..." | |
cat hosts-mvps >> /etc/hosts | |
echo "Adding someonewhocares.org hosts file content to main hosts file..." | |
cat hosts-swc >> /etc/hosts | |
echo "Cleaning up..." | |
rm hosts-mvps | |
rm hosts-swc | |
echo "Completed!" |