Skip to content

Instantly share code, notes, and snippets.

@shivergard
Created September 21, 2014 12:18
Show Gist options
  • Select an option

  • Save shivergard/50d25d936a9d8cfc49cb to your computer and use it in GitHub Desktop.

Select an option

Save shivergard/50d25d936a9d8cfc49cb to your computer and use it in GitHub Desktop.
#!/bin/bash
NOW=$(date +"%m-%d-%Y")
FILE="hosts.$NOW.txt"
cp /etc/hosts /opt/bckups/$FILE
if [ -z "$1" ];
then
echo "" > /opt/bckups/tmpList
sed '/facebook.com/d;/vk.com/d' /etc/hosts >> /opt/bckups/tmpList
mv /opt/bckups/tmpList /etc/hosts
#echo $HOSTDATA >> /opt/bckups/sss
exit
else
echo "127.0.1.1 vk.com" >> /etc/hosts
echo "127.0.1.1 facebook.com" >> /etc/hosts
echo "127.0.1.1 www.facebook.com" >> /etc/hosts
fi
echo "chrome://net-internals/#dns"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment