Skip to content

Instantly share code, notes, and snippets.

@rodrigobaron
Created May 29, 2013 12:25
Show Gist options
  • Save rodrigobaron/5669900 to your computer and use it in GitHub Desktop.
Save rodrigobaron/5669900 to your computer and use it in GitHub Desktop.
Block ads .. banner and another shits ..
# -*- coding: UTF-8 -*- # ###################################################
# #
# mvps_hosts - Sync MVPS HOSTS #
# #
# DESCRIPTION #
# The Sync MVPS HOSTS backup your hosts file ... download the mvps hosts #
# and join into the new hosts file... if you need add or remove a custom host #
# change the older file "/etc/hosts_bak" #
# #
# REQUERIMENT #
# - wget #
# #
# AUTHOR #
# Rodrigo Baron aka saage #
# #
###############################################################################
#!/bin/bash
orig="/etc/hosts"
older="/etc/hosts_bak"
new="/etc/hosts_mvps"
if [ ! -b "$older" ];
then
mv "$orig" "$older"
fi
cat "$older" > "$orig"
if [ ! -b "$new" ];
then
rm "$new"
fi
wget -c "http://winhelp2002.mvps.org/hosts.txt" -O "$new"
cat "$new" >> "$orig"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment