Skip to content

Commit

Permalink
Merge pull request #95 from OpenInternet/verizon_does_it_better
Browse files Browse the repository at this point in the history
Added default copilot.local DNS redirection.
  • Loading branch information
seamustuohy committed Sep 5, 2015
2 parents edb670a + 88d6312 commit 8060585
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 5 additions & 1 deletion copilot/plugins/dns/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def __init__(self):
super(ConfigWriter, self).__init__()
log.debug("Initializing dns config writer.")
self.config_type = "dns"
self.header = "[A]\n"
# This copilot.local redirection is needed by default to combat ISP redirection
# ISP's like verizon, much like this plugin, do DNS-redirection
# They often do it for advertising, in fact, they do it at my apartment
# This has finaly been useful, it helped my ID the bug that forced this change.
self.header = "[A]\n*.copilot.local = 192.168.12.1\n"

def add_rule(self, rule):
action, target, sub = rule[0], rule[1], rule[2]
Expand Down
12 changes: 5 additions & 7 deletions copilot/plugins/dns/start
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ readonly pid_file="/tmp/dnschef.pid"
start_dnschef() {
if [[ -e "$custom_profile" ]]; then
echo "Starting with a custom DNSChef profile."
#Write PID to custom file in 5 seconds for later killing
$(sleep 5 && echo $(pgrep -f python.*dnschef) > "$pid_file") &
"$command" --file="$custom_profile"
else
echo "Starting with an empty DNSChef profile."
#Write PID to custom file in 5 seconds for later killing
$(sleep 5 && echo $(pgrep -f python.*dnschef) > "$pid_file") &
"$command"

printf '[A]\n*.copilot.local = 192.168.12.1' > "$custom_profile"
fi

#Write PID to custom file in 5 seconds for later killing
$(sleep 5 && echo $(pgrep -f python.*dnschef) > "$pid_file") &
"$command" --file="$custom_profile"
}

kill_old() {
Expand Down

0 comments on commit 8060585

Please sign in to comment.