Created
August 28, 2023 05:57
-
-
Save Shujito/54abb1760eaae8d9c514a0ad010a295e to your computer and use it in GitHub Desktop.
Update/Restore unified hosts file.
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
if [ -s /etc/hosts.bak ]; then | |
echo '[ Restoring your original hosts file ]' | |
sudo mv /etc/hosts.bak /etc/hosts | |
echo '[ Done! ]' | |
else | |
echo '[ There is nothing to do... ]' | |
fi |
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
if [ -s /etc/hosts ] && [ ! -s /etc/hosts.bak ]; then | |
echo '[ Backing up your original hosts file... ]' | |
sudo cp /etc/hosts /etc/hosts.bak | |
fi | |
TEMPHOSTS=temphosts.txt | |
cat /etc/hosts > $TEMPHOSTS | |
echo '[ Downloading unified hosts... ]' | |
curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts >> $TEMPHOSTS | |
#ls -hl $TEMPHOSTS | |
echo '[ Replacing hosts with new hosts file... ]' | |
sudo cp $TEMPHOSTS /etc/hosts | |
rm $TEMPHOSTS | |
echo '[ Done! ]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment