Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
szolin committed Mar 19, 2020
1 parent 4540aed commit 6cfabc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dnsfilter/auto_hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,21 @@ func (a *AutoHosts) Init() {
a.hostsDirs = append(a.hostsDirs, "/tmp/hosts") // OpenWRT: "/tmp/hosts/dhcp.cfg01411c"
}

go a.update()
a.updateChan <- true

var err error
a.watcher, err = fsnotify.NewWatcher()
if err != nil {
log.Error("AutoHosts: %s", err)
}
}

// Start - start module
func (a *AutoHosts) Start() {
go a.update()
a.updateChan <- true

go a.watcherLoop()

err = a.watcher.Add(a.hostsFn)
err := a.watcher.Add(a.hostsFn)
if err != nil {
log.Error("AutoHosts: %s", err)
}
Expand Down
1 change: 1 addition & 0 deletions home/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ func run(args options) {
log.Fatalf("%s", err)
}
Context.tls.Start()
Context.autoHosts.Start()

go func() {
err := startDNSServer()
Expand Down

0 comments on commit 6cfabc0

Please sign in to comment.