Tuesday, October 6, 2015

Block unwanted advertisements with /etc/hosts file on Linux


Now we will make the shell script.
run:

vi /root/update_hosts.sh

Fill the file with the following:
 
#!/bin/bash
cd /tmp
wget http://winhelp2002.mvps.org/hosts.txt
rm /etc/hosts
mv hosts.txt /etc/hosts
cat ~/.etchosts >> /etc/hosts


Now we have to make sure the script is executable: 
chmod +x update_hosts.sh
./update_hosts.sh
For Windows check this : http://winhelp2002.mvps.org/

No comments:

Post a Comment